<html>
<head>
  <title>../ex15big.c</title>
</head>
<body bgcolor="#ffffff" text="#000000">
<a href="../ex15big.c">download the original source code</a>.
<pre>
<a name="line1">   1</a> <font color="#444444">/*
<a name="line2">   2</a>    Example 15big
<a name="line3">   3</a> 
<a name="line4">   4</a>    Interface:      Semi-Structured interface (SStruct)
<a name="line5">   5</a> 
<a name="line6">   6</a>    Compile with:   make ex15big
<a name="line7">   7</a> 
<a name="line8">   8</a>    Sample run:     mpirun -np 8 ex15big -n 10
<a name="line9">   9</a> 
<a name="line10">  10</a>    To see options: ex15big -help
<a name="line11">  11</a> 
<a name="line12">  12</a>    Description:    This example is a slight modification of Example 15 that
<a name="line13">  13</a>                    illustrates the 64-bit integer support in hypre needed to
<a name="line14">  14</a>                    runproblems with more than 2B unknowns.
<a name="line15">  15</a> 
<a name="line16">  16</a>                    Specifically, the changes compared to Example 15 are as
<a name="line17">  17</a>                    follows:
<a name="line18">  18</a> 
<a name="line19">  19</a>                    1) All integer arguments to HYPRE functions should be
<a name="line20">  20</a>                       declared of type HYPRE_Int.
<a name="line21">  21</a> 
<a name="line22">  22</a>                    2) Variables of type HYPRE_Int are 64-bit integers, so
<a name="line23">  23</a>                       they should be printed in the %lld format (not %d).
<a name="line24">  24</a> 
<a name="line25">  25</a>                    To enable the 64-bit integer support, you need to build
<a name="line26">  26</a>                    hypre with the --enable-bigint option of 'configure'.
<a name="line27">  27</a>                    We recommend comparing this example with Example 15.
<a name="line28">  28</a> */</font>
<a name="line29">  29</a> 
<a name="line30">  30</a> <font color="0000ff"><strong>#include <font color="#008000">&lt;math.h&gt;</font></strong></font>
<a name="line31">  31</a> <font color="0000ff"><strong>#include <font color="#008000">&quot;_hypre_utilities.h&quot;</font></strong></font>
<a name="line32">  32</a> <font color="0000ff"><strong>#include <font color="#008000">&quot;HYPRE_sstruct_mv.h&quot;</font></strong></font>
<a name="line33">  33</a> <font color="0000ff"><strong>#include <font color="#008000">&quot;HYPRE_sstruct_ls.h&quot;</font></strong></font>
<a name="line34">  34</a> <font color="0000ff"><strong>#include <font color="#008000">&quot;_hypre_parcsr_ls.h&quot;</font></strong></font>
<a name="line35">  35</a> <font color="0000ff"><strong>#include <font color="#008000">&quot;HYPRE.h&quot;</font></strong></font>
<a name="line36">  36</a> 
<a name="line37">  37</a> 
<a name="line38">  38</a> <strong>int</strong> <font color="#2040a0">optionAlpha</font>, <font color="#2040a0">optionBeta</font><font color="4444FF">;</font>
<a name="line39">  39</a> 
<a name="line40">  40</a> <font color="#444444">/* Curl-curl coefficient alpha = mu^{-1} */</font>
<a name="line41">  41</a> <strong>double</strong> <font color="#2040a0">alpha</font><font color="4444FF">(</font><strong>double</strong> <font color="#2040a0">x</font>, <strong>double</strong> <font color="#2040a0">y</font>, <strong>double</strong> <font color="#2040a0">z</font><font color="4444FF">)</font>
<a name="line42">  42</a> <font color="4444FF"><strong>{</strong></font>
<a name="line43">  43</a>    <strong>switch</strong> <font color="4444FF">(</font><font color="#2040a0">optionAlpha</font><font color="4444FF">)</font>
<a name="line44">  44</a>    <font color="4444FF"><strong>{</strong></font>
<a name="line45">  45</a>       <strong>case</strong> <font color="#FF0000">0</font><font color="4444FF">:</font> <font color="#444444">/* uniform coefficient */</font>
<a name="line46">  46</a>          <strong>return</strong> <font color="#FF0000">1.0</font><font color="4444FF">;</font>
<a name="line47">  47</a>       <strong>case</strong> <font color="#FF0000">1</font><font color="4444FF">:</font> <font color="#444444">/* smooth coefficient */</font>
<a name="line48">  48</a>          <strong>return</strong> <font color="#2040a0">x</font><font color="4444FF">*</font><font color="#2040a0">x</font><font color="4444FF">+</font><font color="#2040a0">exp</font><font color="4444FF">(</font><font color="#2040a0">y</font><font color="4444FF">)</font><font color="4444FF">+</font><font color="#2040a0">sin</font><font color="4444FF">(</font><font color="#2040a0">z</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line49">  49</a>       <strong>case</strong> <font color="#FF0000">2</font><font color="4444FF">:</font> <font color="#444444">/* small outside of an interior cube */</font>
<a name="line50">  50</a>          <strong>if</strong> <font color="4444FF">(</font><font color="4444FF">(</font><font color="#2040a0">fabs</font><font color="4444FF">(</font><font color="#2040a0">x</font><font color="4444FF">-</font><font color="#FF0000">0.5</font><font color="4444FF">)</font> <font color="4444FF">&lt;</font> <font color="#FF0000">0.25</font><font color="4444FF">)</font> <font color="4444FF">&amp;</font><font color="4444FF">&amp;</font> <font color="4444FF">(</font><font color="#2040a0">fabs</font><font color="4444FF">(</font><font color="#2040a0">y</font><font color="4444FF">-</font><font color="#FF0000">0.5</font><font color="4444FF">)</font> <font color="4444FF">&lt;</font> <font color="#FF0000">0.25</font><font color="4444FF">)</font> <font color="4444FF">&amp;</font><font color="4444FF">&amp;</font> <font color="4444FF">(</font><font color="#2040a0">fabs</font><font color="4444FF">(</font><font color="#2040a0">z</font><font color="4444FF">-</font><font color="#FF0000">0.5</font><font color="4444FF">)</font> <font color="4444FF">&lt;</font> <font color="#FF0000">0.25</font><font color="4444FF">)</font><font color="4444FF">)</font>
<a name="line51">  51</a>             <strong>return</strong> <font color="#FF0000">1.0</font><font color="4444FF">;</font>
<a name="line52">  52</a>          <strong>else</strong>
<a name="line53">  53</a>             <strong>return</strong> <font color="#FF0000">1.0e-6</font><font color="4444FF">;</font>
<a name="line54">  54</a>       <strong>case</strong> <font color="#FF0000">3</font><font color="4444FF">:</font> <font color="#444444">/* small outside of an interior ball */</font>
<a name="line55">  55</a>          <strong>if</strong> <font color="4444FF">(</font><font color="4444FF">(</font><font color="4444FF">(</font><font color="#2040a0">x</font><font color="4444FF">-</font><font color="#FF0000">0.5</font><font color="4444FF">)</font><font color="4444FF">*</font><font color="4444FF">(</font><font color="#2040a0">x</font><font color="4444FF">-</font><font color="#FF0000">0.5</font><font color="4444FF">)</font><font color="4444FF">+</font><font color="4444FF">(</font><font color="#2040a0">y</font><font color="4444FF">-</font><font color="#FF0000">0.5</font><font color="4444FF">)</font><font color="4444FF">*</font><font color="4444FF">(</font><font color="#2040a0">y</font><font color="4444FF">-</font><font color="#FF0000">0.5</font><font color="4444FF">)</font><font color="4444FF">+</font><font color="4444FF">(</font><font color="#2040a0">z</font><font color="4444FF">-</font><font color="#FF0000">0.5</font><font color="4444FF">)</font><font color="4444FF">*</font><font color="4444FF">(</font><font color="#2040a0">z</font><font color="4444FF">-</font><font color="#FF0000">0.5</font><font color="4444FF">)</font><font color="4444FF">)</font> <font color="4444FF">&lt;</font> <font color="#FF0000">0.0625</font><font color="4444FF">)</font>
<a name="line56">  56</a>             <strong>return</strong> <font color="#FF0000">1.0</font><font color="4444FF">;</font>
<a name="line57">  57</a>          <strong>else</strong>
<a name="line58">  58</a>             <strong>return</strong> <font color="#FF0000">1.0e-6</font><font color="4444FF">;</font>
<a name="line59">  59</a>       <strong>case</strong> <font color="#FF0000">4</font><font color="4444FF">:</font> <font color="#444444">/* random coefficient */</font>
<a name="line60">  60</a>          <strong>return</strong> <font color="#2040a0">hypre_Rand</font><font color="4444FF">(</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line61">  61</a>       <strong>default</strong><font color="4444FF">:</font>
<a name="line62">  62</a>          <strong>return</strong> <font color="#FF0000">1.0</font><font color="4444FF">;</font>
<a name="line63">  63</a>    <font color="4444FF"><strong>}</strong></font>
<a name="line64">  64</a> <font color="4444FF"><strong>}</strong></font>
<a name="line65">  65</a> 
<a name="line66">  66</a> <font color="#444444">/* Mass coefficient beta = sigma */</font>
<a name="line67">  67</a> <strong>double</strong> <font color="#2040a0">beta</font><font color="4444FF">(</font><strong>double</strong> <font color="#2040a0">x</font>, <strong>double</strong> <font color="#2040a0">y</font>, <strong>double</strong> <font color="#2040a0">z</font><font color="4444FF">)</font>
<a name="line68">  68</a> <font color="4444FF"><strong>{</strong></font>
<a name="line69">  69</a>    <strong>switch</strong> <font color="4444FF">(</font><font color="#2040a0">optionBeta</font><font color="4444FF">)</font>
<a name="line70">  70</a>    <font color="4444FF"><strong>{</strong></font>
<a name="line71">  71</a>       <strong>case</strong> <font color="#FF0000">0</font><font color="4444FF">:</font> <font color="#444444">/* uniform coefficient */</font>
<a name="line72">  72</a>          <strong>return</strong> <font color="#FF0000">1.0</font><font color="4444FF">;</font>
<a name="line73">  73</a>       <strong>case</strong> <font color="#FF0000">1</font><font color="4444FF">:</font> <font color="#444444">/* smooth coefficient */</font>
<a name="line74">  74</a>          <strong>return</strong> <font color="#2040a0">x</font><font color="4444FF">*</font><font color="#2040a0">x</font><font color="4444FF">+</font><font color="#2040a0">exp</font><font color="4444FF">(</font><font color="#2040a0">y</font><font color="4444FF">)</font><font color="4444FF">+</font><font color="#2040a0">sin</font><font color="4444FF">(</font><font color="#2040a0">z</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line75">  75</a>       <strong>case</strong> <font color="#FF0000">2</font><font color="4444FF">:</font><font color="#444444">/* small outside of interior cube */</font>
<a name="line76">  76</a>          <strong>if</strong> <font color="4444FF">(</font><font color="4444FF">(</font><font color="#2040a0">fabs</font><font color="4444FF">(</font><font color="#2040a0">x</font><font color="4444FF">-</font><font color="#FF0000">0.5</font><font color="4444FF">)</font> <font color="4444FF">&lt;</font> <font color="#FF0000">0.25</font><font color="4444FF">)</font> <font color="4444FF">&amp;</font><font color="4444FF">&amp;</font> <font color="4444FF">(</font><font color="#2040a0">fabs</font><font color="4444FF">(</font><font color="#2040a0">y</font><font color="4444FF">-</font><font color="#FF0000">0.5</font><font color="4444FF">)</font> <font color="4444FF">&lt;</font> <font color="#FF0000">0.25</font><font color="4444FF">)</font> <font color="4444FF">&amp;</font><font color="4444FF">&amp;</font> <font color="4444FF">(</font><font color="#2040a0">fabs</font><font color="4444FF">(</font><font color="#2040a0">z</font><font color="4444FF">-</font><font color="#FF0000">0.5</font><font color="4444FF">)</font> <font color="4444FF">&lt;</font> <font color="#FF0000">0.25</font><font color="4444FF">)</font><font color="4444FF">)</font>
<a name="line77">  77</a>             <strong>return</strong> <font color="#FF0000">1.0</font><font color="4444FF">;</font>
<a name="line78">  78</a>          <strong>else</strong>
<a name="line79">  79</a>             <strong>return</strong> <font color="#FF0000">1.0e-6</font><font color="4444FF">;</font>
<a name="line80">  80</a>       <strong>case</strong> <font color="#FF0000">3</font><font color="4444FF">:</font> <font color="#444444">/* small outside of an interior ball */</font>
<a name="line81">  81</a>          <strong>if</strong> <font color="4444FF">(</font><font color="4444FF">(</font><font color="4444FF">(</font><font color="#2040a0">x</font><font color="4444FF">-</font><font color="#FF0000">0.5</font><font color="4444FF">)</font><font color="4444FF">*</font><font color="4444FF">(</font><font color="#2040a0">x</font><font color="4444FF">-</font><font color="#FF0000">0.5</font><font color="4444FF">)</font><font color="4444FF">+</font><font color="4444FF">(</font><font color="#2040a0">y</font><font color="4444FF">-</font><font color="#FF0000">0.5</font><font color="4444FF">)</font><font color="4444FF">*</font><font color="4444FF">(</font><font color="#2040a0">y</font><font color="4444FF">-</font><font color="#FF0000">0.5</font><font color="4444FF">)</font><font color="4444FF">+</font><font color="4444FF">(</font><font color="#2040a0">z</font><font color="4444FF">-</font><font color="#FF0000">0.5</font><font color="4444FF">)</font><font color="4444FF">*</font><font color="4444FF">(</font><font color="#2040a0">z</font><font color="4444FF">-</font><font color="#FF0000">0.5</font><font color="4444FF">)</font><font color="4444FF">)</font> <font color="4444FF">&lt;</font> <font color="#FF0000">0.0625</font><font color="4444FF">)</font>
<a name="line82">  82</a>             <strong>return</strong> <font color="#FF0000">1.0</font><font color="4444FF">;</font>
<a name="line83">  83</a>          <strong>else</strong>
<a name="line84">  84</a>             <strong>return</strong> <font color="#FF0000">1.0e-6</font><font color="4444FF">;</font>
<a name="line85">  85</a>       <strong>case</strong> <font color="#FF0000">4</font><font color="4444FF">:</font> <font color="#444444">/* random coefficient */</font>
<a name="line86">  86</a>          <strong>return</strong> <font color="#2040a0">hypre_Rand</font><font color="4444FF">(</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line87">  87</a>       <strong>default</strong><font color="4444FF">:</font>
<a name="line88">  88</a>          <strong>return</strong> <font color="#FF0000">1.0</font><font color="4444FF">;</font>
<a name="line89">  89</a>    <font color="4444FF"><strong>}</strong></font>
<a name="line90">  90</a> <font color="4444FF"><strong>}</strong></font>
<a name="line91">  91</a> 
<a name="line92">  92</a> <font color="#444444">/*
<a name="line93">  93</a>    This routine computes the lowest order Nedelec, or &quot;edge&quot; finite element
<a name="line94">  94</a>    stiffness matrix and load vector on a cube of size h.  The 12 edges {e_i}
<a name="line95">  95</a>    are numbered in terms of the vertices as follows:
<a name="line96">  96</a> 
<a name="line97">  97</a>            [7]------[6]
<a name="line98">  98</a>            /|       /|     e_0 = 01, e_1 = 12, e_2  = 32, e_3  = 03,
<a name="line99">  99</a>           / |      / |     e_4 = 45, e_5 = 56, e_6  = 76, e_7  = 47,
<a name="line100"> 100</a>         [4]------[5] |     e_8 = 04, e_9 = 15, e_10 = 26, e_11 = 37.
<a name="line101"> 101</a>          | [3]----|-[2]
<a name="line102"> 102</a>          | /      | /      The edges are oriented from first to the
<a name="line103"> 103</a>          |/       |/       second vertex, e.g. e_0 is from [0] to [1].
<a name="line104"> 104</a>         [0]------[1]
<a name="line105"> 105</a> 
<a name="line106"> 106</a>    We allow for different scaling of the curl-curl and the mass parts of the
<a name="line107"> 107</a>    matrix with coefficients alpha and beta respectively:
<a name="line108"> 108</a> 
<a name="line109"> 109</a>          S_ij = alpha (curl phi_i,curl phi_j) + beta (phi_i, phi_j).
<a name="line110"> 110</a> 
<a name="line111"> 111</a>    The load vector corresponding to a right-hand side of {1,1,1} is
<a name="line112"> 112</a> 
<a name="line113"> 113</a>                         F_j = (1,phi_j) = h^2/4.
<a name="line114"> 114</a> */</font>
<a name="line115"> 115</a> <strong>void</strong> <font color="#2040a0">ComputeFEMND1</font><font color="4444FF">(</font><strong>double</strong> <font color="#2040a0">S</font><font color="4444FF">[</font><font color="#FF0000">12</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">12</font><font color="4444FF">]</font>, <strong>double</strong> <font color="#2040a0">F</font><font color="4444FF">[</font><font color="#FF0000">12</font><font color="4444FF">]</font>,
<a name="line116"> 116</a>                    <strong>double</strong> <font color="#2040a0">x</font>, <strong>double</strong> <font color="#2040a0">y</font>, <strong>double</strong> <font color="#2040a0">z</font>, <strong>double</strong> <font color="#2040a0">h</font><font color="4444FF">)</font>
<a name="line117"> 117</a> <font color="4444FF"><strong>{</strong></font>
<a name="line118"> 118</a>    <strong>int</strong> <font color="#2040a0">i</font>, <font color="#2040a0">j</font><font color="4444FF">;</font>
<a name="line119"> 119</a> 
<a name="line120"> 120</a>    <strong>double</strong> <font color="#2040a0">h2_4</font> <font color="4444FF">=</font> <font color="#2040a0">h</font><font color="4444FF">*</font><font color="#2040a0">h</font>/<font color="#FF0000">4</font><font color="4444FF">;</font>
<a name="line121"> 121</a> 
<a name="line122"> 122</a>    <strong>double</strong> <font color="#2040a0">cS1</font> <font color="4444FF">=</font> <font color="#2040a0">alpha</font><font color="4444FF">(</font><font color="#2040a0">x</font>,<font color="#2040a0">y</font>,<font color="#2040a0">z</font><font color="4444FF">)</font>/<font color="4444FF">(</font><font color="#FF0000">6.0</font><font color="4444FF">*</font><font color="#2040a0">h</font><font color="4444FF">)</font>, <font color="#2040a0">cS2</font> <font color="4444FF">=</font> <font color="#FF0000">2</font><font color="4444FF">*</font><font color="#2040a0">cS1</font>, <font color="#2040a0">cS4</font> <font color="4444FF">=</font> <font color="#FF0000">2</font><font color="4444FF">*</font><font color="#2040a0">cS2</font><font color="4444FF">;</font>
<a name="line123"> 123</a>    <strong>double</strong> <font color="#2040a0">cM1</font> <font color="4444FF">=</font> <font color="#2040a0">beta</font><font color="4444FF">(</font><font color="#2040a0">x</font>,<font color="#2040a0">y</font>,<font color="#2040a0">z</font><font color="4444FF">)</font><font color="4444FF">*</font><font color="#2040a0">h</font>/<font color="#FF0000">36.0</font>,   <font color="#2040a0">cM2</font> <font color="4444FF">=</font> <font color="#FF0000">2</font><font color="4444FF">*</font><font color="#2040a0">cM1</font>, <font color="#2040a0">cM4</font> <font color="4444FF">=</font> <font color="#FF0000">2</font><font color="4444FF">*</font><font color="#2040a0">cM2</font><font color="4444FF">;</font>
<a name="line124"> 124</a> 
<a name="line125"> 125</a>    <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">0</font><font color="4444FF">]</font><font color="4444FF">[</font> <font color="#FF0000">0</font><font color="4444FF">]</font> <font color="4444FF">=</font>  <font color="#2040a0">cS4</font> <font color="4444FF">+</font> <font color="#2040a0">cM4</font><font color="4444FF">;</font>   <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">0</font><font color="4444FF">]</font><font color="4444FF">[</font> <font color="#FF0000">1</font><font color="4444FF">]</font> <font color="4444FF">=</font>  <font color="#2040a0">cS2</font><font color="4444FF">;</font>         <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">0</font><font color="4444FF">]</font><font color="4444FF">[</font> <font color="#FF0000">2</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF">-</font><font color="#2040a0">cS1</font> <font color="4444FF">+</font> <font color="#2040a0">cM2</font><font color="4444FF">;</font>
<a name="line126"> 126</a>    <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">0</font><font color="4444FF">]</font><font color="4444FF">[</font> <font color="#FF0000">3</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF">-</font><font color="#2040a0">cS2</font><font color="4444FF">;</font>         <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">0</font><font color="4444FF">]</font><font color="4444FF">[</font> <font color="#FF0000">4</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF">-</font><font color="#2040a0">cS1</font> <font color="4444FF">+</font> <font color="#2040a0">cM2</font><font color="4444FF">;</font>   <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">0</font><font color="4444FF">]</font><font color="4444FF">[</font> <font color="#FF0000">5</font><font color="4444FF">]</font> <font color="4444FF">=</font>  <font color="#2040a0">cS1</font><font color="4444FF">;</font>
<a name="line127"> 127</a>    <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">0</font><font color="4444FF">]</font><font color="4444FF">[</font> <font color="#FF0000">6</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF">-</font><font color="#2040a0">cS2</font> <font color="4444FF">+</font> <font color="#2040a0">cM1</font><font color="4444FF">;</font>   <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">0</font><font color="4444FF">]</font><font color="4444FF">[</font> <font color="#FF0000">7</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF">-</font><font color="#2040a0">cS1</font><font color="4444FF">;</font>         <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">0</font><font color="4444FF">]</font><font color="4444FF">[</font> <font color="#FF0000">8</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF">-</font><font color="#2040a0">cS2</font><font color="4444FF">;</font>
<a name="line128"> 128</a>    <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">0</font><font color="4444FF">]</font><font color="4444FF">[</font> <font color="#FF0000">9</font><font color="4444FF">]</font> <font color="4444FF">=</font>  <font color="#2040a0">cS2</font><font color="4444FF">;</font>         <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">0</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">10</font><font color="4444FF">]</font> <font color="4444FF">=</font>  <font color="#2040a0">cS1</font><font color="4444FF">;</font>         <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">0</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">11</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF">-</font><font color="#2040a0">cS1</font><font color="4444FF">;</font>
<a name="line129"> 129</a> 
<a name="line130"> 130</a>    <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">1</font><font color="4444FF">]</font><font color="4444FF">[</font> <font color="#FF0000">1</font><font color="4444FF">]</font> <font color="4444FF">=</font>  <font color="#2040a0">cS4</font> <font color="4444FF">+</font> <font color="#2040a0">cM4</font><font color="4444FF">;</font>   <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">1</font><font color="4444FF">]</font><font color="4444FF">[</font> <font color="#FF0000">2</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF">-</font><font color="#2040a0">cS2</font><font color="4444FF">;</font>         <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">1</font><font color="4444FF">]</font><font color="4444FF">[</font> <font color="#FF0000">3</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF">-</font><font color="#2040a0">cS1</font> <font color="4444FF">+</font> <font color="#2040a0">cM2</font><font color="4444FF">;</font>
<a name="line131"> 131</a>    <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">1</font><font color="4444FF">]</font><font color="4444FF">[</font> <font color="#FF0000">4</font><font color="4444FF">]</font> <font color="4444FF">=</font>  <font color="#2040a0">cS1</font><font color="4444FF">;</font>         <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">1</font><font color="4444FF">]</font><font color="4444FF">[</font> <font color="#FF0000">5</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF">-</font><font color="#2040a0">cS1</font> <font color="4444FF">+</font> <font color="#2040a0">cM2</font><font color="4444FF">;</font>   <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">1</font><font color="4444FF">]</font><font color="4444FF">[</font> <font color="#FF0000">6</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF">-</font><font color="#2040a0">cS1</font><font color="4444FF">;</font>
<a name="line132"> 132</a>    <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">1</font><font color="4444FF">]</font><font color="4444FF">[</font> <font color="#FF0000">7</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF">-</font><font color="#2040a0">cS2</font> <font color="4444FF">+</font> <font color="#2040a0">cM1</font><font color="4444FF">;</font>   <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">1</font><font color="4444FF">]</font><font color="4444FF">[</font> <font color="#FF0000">8</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF">-</font><font color="#2040a0">cS1</font><font color="4444FF">;</font>         <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">1</font><font color="4444FF">]</font><font color="4444FF">[</font> <font color="#FF0000">9</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF">-</font><font color="#2040a0">cS2</font><font color="4444FF">;</font>
<a name="line133"> 133</a>    <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">1</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">10</font><font color="4444FF">]</font> <font color="4444FF">=</font>  <font color="#2040a0">cS2</font><font color="4444FF">;</font>         <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">1</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">11</font><font color="4444FF">]</font> <font color="4444FF">=</font>  <font color="#2040a0">cS1</font><font color="4444FF">;</font>
<a name="line134"> 134</a> 
<a name="line135"> 135</a>    <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">2</font><font color="4444FF">]</font><font color="4444FF">[</font> <font color="#FF0000">2</font><font color="4444FF">]</font> <font color="4444FF">=</font>  <font color="#2040a0">cS4</font> <font color="4444FF">+</font> <font color="#2040a0">cM4</font><font color="4444FF">;</font>   <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">2</font><font color="4444FF">]</font><font color="4444FF">[</font> <font color="#FF0000">3</font><font color="4444FF">]</font> <font color="4444FF">=</font>  <font color="#2040a0">cS2</font><font color="4444FF">;</font>         <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">2</font><font color="4444FF">]</font><font color="4444FF">[</font> <font color="#FF0000">4</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF">-</font><font color="#2040a0">cS2</font> <font color="4444FF">+</font> <font color="#2040a0">cM1</font><font color="4444FF">;</font>
<a name="line136"> 136</a>    <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">2</font><font color="4444FF">]</font><font color="4444FF">[</font> <font color="#FF0000">5</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF">-</font><font color="#2040a0">cS1</font><font color="4444FF">;</font>         <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">2</font><font color="4444FF">]</font><font color="4444FF">[</font> <font color="#FF0000">6</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF">-</font><font color="#2040a0">cS1</font> <font color="4444FF">+</font> <font color="#2040a0">cM2</font><font color="4444FF">;</font>   <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">2</font><font color="4444FF">]</font><font color="4444FF">[</font> <font color="#FF0000">7</font><font color="4444FF">]</font> <font color="4444FF">=</font>  <font color="#2040a0">cS1</font><font color="4444FF">;</font>
<a name="line137"> 137</a>    <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">2</font><font color="4444FF">]</font><font color="4444FF">[</font> <font color="#FF0000">8</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF">-</font><font color="#2040a0">cS1</font><font color="4444FF">;</font>         <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">2</font><font color="4444FF">]</font><font color="4444FF">[</font> <font color="#FF0000">9</font><font color="4444FF">]</font> <font color="4444FF">=</font>  <font color="#2040a0">cS1</font><font color="4444FF">;</font>         <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">2</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">10</font><font color="4444FF">]</font> <font color="4444FF">=</font>  <font color="#2040a0">cS2</font><font color="4444FF">;</font>
<a name="line138"> 138</a>    <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">2</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">11</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF">-</font><font color="#2040a0">cS2</font><font color="4444FF">;</font>
<a name="line139"> 139</a> 
<a name="line140"> 140</a>    <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">3</font><font color="4444FF">]</font><font color="4444FF">[</font> <font color="#FF0000">3</font><font color="4444FF">]</font> <font color="4444FF">=</font>  <font color="#2040a0">cS4</font> <font color="4444FF">+</font> <font color="#2040a0">cM4</font><font color="4444FF">;</font>   <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">3</font><font color="4444FF">]</font><font color="4444FF">[</font> <font color="#FF0000">4</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF">-</font><font color="#2040a0">cS1</font><font color="4444FF">;</font>         <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">3</font><font color="4444FF">]</font><font color="4444FF">[</font> <font color="#FF0000">5</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF">-</font><font color="#2040a0">cS2</font> <font color="4444FF">+</font> <font color="#2040a0">cM1</font><font color="4444FF">;</font>
<a name="line141"> 141</a>    <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">3</font><font color="4444FF">]</font><font color="4444FF">[</font> <font color="#FF0000">6</font><font color="4444FF">]</font> <font color="4444FF">=</font>  <font color="#2040a0">cS1</font><font color="4444FF">;</font>         <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">3</font><font color="4444FF">]</font><font color="4444FF">[</font> <font color="#FF0000">7</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF">-</font><font color="#2040a0">cS1</font> <font color="4444FF">+</font> <font color="#2040a0">cM2</font><font color="4444FF">;</font>   <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">3</font><font color="4444FF">]</font><font color="4444FF">[</font> <font color="#FF0000">8</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF">-</font><font color="#2040a0">cS2</font><font color="4444FF">;</font>
<a name="line142"> 142</a>    <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">3</font><font color="4444FF">]</font><font color="4444FF">[</font> <font color="#FF0000">9</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF">-</font><font color="#2040a0">cS1</font><font color="4444FF">;</font>         <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">3</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">10</font><font color="4444FF">]</font> <font color="4444FF">=</font>  <font color="#2040a0">cS1</font><font color="4444FF">;</font>         <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">3</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">11</font><font color="4444FF">]</font> <font color="4444FF">=</font>  <font color="#2040a0">cS2</font><font color="4444FF">;</font>
<a name="line143"> 143</a> 
<a name="line144"> 144</a>    <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">4</font><font color="4444FF">]</font><font color="4444FF">[</font> <font color="#FF0000">4</font><font color="4444FF">]</font> <font color="4444FF">=</font>  <font color="#2040a0">cS4</font> <font color="4444FF">+</font> <font color="#2040a0">cM4</font><font color="4444FF">;</font>   <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">4</font><font color="4444FF">]</font><font color="4444FF">[</font> <font color="#FF0000">5</font><font color="4444FF">]</font> <font color="4444FF">=</font>  <font color="#2040a0">cS2</font><font color="4444FF">;</font>         <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">4</font><font color="4444FF">]</font><font color="4444FF">[</font> <font color="#FF0000">6</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF">-</font><font color="#2040a0">cS1</font> <font color="4444FF">+</font> <font color="#2040a0">cM2</font><font color="4444FF">;</font>
<a name="line145"> 145</a>    <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">4</font><font color="4444FF">]</font><font color="4444FF">[</font> <font color="#FF0000">7</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF">-</font><font color="#2040a0">cS2</font><font color="4444FF">;</font>         <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">4</font><font color="4444FF">]</font><font color="4444FF">[</font> <font color="#FF0000">8</font><font color="4444FF">]</font> <font color="4444FF">=</font>  <font color="#2040a0">cS2</font><font color="4444FF">;</font>         <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">4</font><font color="4444FF">]</font><font color="4444FF">[</font> <font color="#FF0000">9</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF">-</font><font color="#2040a0">cS2</font><font color="4444FF">;</font>
<a name="line146"> 146</a>    <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">4</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">10</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF">-</font><font color="#2040a0">cS1</font><font color="4444FF">;</font>         <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">4</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">11</font><font color="4444FF">]</font> <font color="4444FF">=</font>  <font color="#2040a0">cS1</font><font color="4444FF">;</font>
<a name="line147"> 147</a> 
<a name="line148"> 148</a>    <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">5</font><font color="4444FF">]</font><font color="4444FF">[</font> <font color="#FF0000">5</font><font color="4444FF">]</font> <font color="4444FF">=</font>  <font color="#2040a0">cS4</font> <font color="4444FF">+</font> <font color="#2040a0">cM4</font><font color="4444FF">;</font>   <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">5</font><font color="4444FF">]</font><font color="4444FF">[</font> <font color="#FF0000">6</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF">-</font><font color="#2040a0">cS2</font><font color="4444FF">;</font>         <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">5</font><font color="4444FF">]</font><font color="4444FF">[</font> <font color="#FF0000">7</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF">-</font><font color="#2040a0">cS1</font> <font color="4444FF">+</font> <font color="#2040a0">cM2</font><font color="4444FF">;</font>
<a name="line149"> 149</a>    <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">5</font><font color="4444FF">]</font><font color="4444FF">[</font> <font color="#FF0000">8</font><font color="4444FF">]</font> <font color="4444FF">=</font>  <font color="#2040a0">cS1</font><font color="4444FF">;</font>         <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">5</font><font color="4444FF">]</font><font color="4444FF">[</font> <font color="#FF0000">9</font><font color="4444FF">]</font> <font color="4444FF">=</font>  <font color="#2040a0">cS2</font><font color="4444FF">;</font>         <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">5</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">10</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF">-</font><font color="#2040a0">cS2</font><font color="4444FF">;</font>
<a name="line150"> 150</a>    <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">5</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">11</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF">-</font><font color="#2040a0">cS1</font><font color="4444FF">;</font>
<a name="line151"> 151</a> 
<a name="line152"> 152</a>    <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">6</font><font color="4444FF">]</font><font color="4444FF">[</font> <font color="#FF0000">6</font><font color="4444FF">]</font> <font color="4444FF">=</font>  <font color="#2040a0">cS4</font> <font color="4444FF">+</font> <font color="#2040a0">cM4</font><font color="4444FF">;</font>   <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">6</font><font color="4444FF">]</font><font color="4444FF">[</font> <font color="#FF0000">7</font><font color="4444FF">]</font> <font color="4444FF">=</font>  <font color="#2040a0">cS2</font><font color="4444FF">;</font>         <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">6</font><font color="4444FF">]</font><font color="4444FF">[</font> <font color="#FF0000">8</font><font color="4444FF">]</font> <font color="4444FF">=</font>  <font color="#2040a0">cS1</font><font color="4444FF">;</font>
<a name="line153"> 153</a>    <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">6</font><font color="4444FF">]</font><font color="4444FF">[</font> <font color="#FF0000">9</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF">-</font><font color="#2040a0">cS1</font><font color="4444FF">;</font>         <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">6</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">10</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF">-</font><font color="#2040a0">cS2</font><font color="4444FF">;</font>         <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">6</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">11</font><font color="4444FF">]</font> <font color="4444FF">=</font>  <font color="#2040a0">cS2</font><font color="4444FF">;</font>
<a name="line154"> 154</a> 
<a name="line155"> 155</a>    <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">7</font><font color="4444FF">]</font><font color="4444FF">[</font> <font color="#FF0000">7</font><font color="4444FF">]</font> <font color="4444FF">=</font>  <font color="#2040a0">cS4</font> <font color="4444FF">+</font> <font color="#2040a0">cM4</font><font color="4444FF">;</font>   <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">7</font><font color="4444FF">]</font><font color="4444FF">[</font> <font color="#FF0000">8</font><font color="4444FF">]</font> <font color="4444FF">=</font>  <font color="#2040a0">cS2</font><font color="4444FF">;</font>         <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">7</font><font color="4444FF">]</font><font color="4444FF">[</font> <font color="#FF0000">9</font><font color="4444FF">]</font> <font color="4444FF">=</font>  <font color="#2040a0">cS1</font><font color="4444FF">;</font>
<a name="line156"> 156</a>    <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">7</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">10</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF">-</font><font color="#2040a0">cS1</font><font color="4444FF">;</font>         <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">7</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">11</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF">-</font><font color="#2040a0">cS2</font><font color="4444FF">;</font>
<a name="line157"> 157</a> 
<a name="line158"> 158</a>    <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">8</font><font color="4444FF">]</font><font color="4444FF">[</font> <font color="#FF0000">8</font><font color="4444FF">]</font> <font color="4444FF">=</font>  <font color="#2040a0">cS4</font> <font color="4444FF">+</font> <font color="#2040a0">cM4</font><font color="4444FF">;</font>   <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">8</font><font color="4444FF">]</font><font color="4444FF">[</font> <font color="#FF0000">9</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF">-</font><font color="#2040a0">cS1</font> <font color="4444FF">+</font> <font color="#2040a0">cM2</font><font color="4444FF">;</font>   <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">8</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">10</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF">-</font><font color="#2040a0">cS2</font> <font color="4444FF">+</font> <font color="#2040a0">cM1</font><font color="4444FF">;</font>
<a name="line159"> 159</a>    <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">8</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">11</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF">-</font><font color="#2040a0">cS1</font> <font color="4444FF">+</font> <font color="#2040a0">cM2</font><font color="4444FF">;</font>
<a name="line160"> 160</a> 
<a name="line161"> 161</a>    <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">9</font><font color="4444FF">]</font><font color="4444FF">[</font> <font color="#FF0000">9</font><font color="4444FF">]</font> <font color="4444FF">=</font>  <font color="#2040a0">cS4</font> <font color="4444FF">+</font> <font color="#2040a0">cM4</font><font color="4444FF">;</font>   <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">9</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">10</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF">-</font><font color="#2040a0">cS1</font> <font color="4444FF">+</font> <font color="#2040a0">cM2</font><font color="4444FF">;</font>   <font color="#2040a0">S</font><font color="4444FF">[</font> <font color="#FF0000">9</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">11</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF">-</font><font color="#2040a0">cS2</font> <font color="4444FF">+</font> <font color="#2040a0">cM1</font><font color="4444FF">;</font>
<a name="line162"> 162</a> 
<a name="line163"> 163</a>    <font color="#2040a0">S</font><font color="4444FF">[</font><font color="#FF0000">10</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">10</font><font color="4444FF">]</font> <font color="4444FF">=</font>  <font color="#2040a0">cS4</font> <font color="4444FF">+</font> <font color="#2040a0">cM4</font><font color="4444FF">;</font>   <font color="#2040a0">S</font><font color="4444FF">[</font><font color="#FF0000">10</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">11</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF">-</font><font color="#2040a0">cS1</font> <font color="4444FF">+</font> <font color="#2040a0">cM2</font><font color="4444FF">;</font>
<a name="line164"> 164</a> 
<a name="line165"> 165</a>    <font color="#2040a0">S</font><font color="4444FF">[</font><font color="#FF0000">11</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">11</font><font color="4444FF">]</font> <font color="4444FF">=</font>  <font color="#2040a0">cS4</font> <font color="4444FF">+</font> <font color="#2040a0">cM4</font><font color="4444FF">;</font>
<a name="line166"> 166</a> 
<a name="line167"> 167</a>    <font color="#444444">/* The stiffness matrix is symmetric */</font>
<a name="line168"> 168</a>    <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">i</font> <font color="4444FF">=</font> <font color="#FF0000">1</font><font color="4444FF">;</font> <font color="#2040a0">i</font> <font color="4444FF">&lt;</font> <font color="#FF0000">12</font><font color="4444FF">;</font> <font color="#2040a0">i</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line169"> 169</a>       <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">j</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">j</font> <font color="4444FF">&lt;</font> <font color="#2040a0">i</font><font color="4444FF">;</font> <font color="#2040a0">j</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line170"> 170</a>          <font color="#2040a0">S</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#2040a0">j</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#2040a0">S</font><font color="4444FF">[</font><font color="#2040a0">j</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">]</font><font color="4444FF">;</font>
<a name="line171"> 171</a> 
<a name="line172"> 172</a>    <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">i</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">i</font> <font color="4444FF">&lt;</font> <font color="#FF0000">12</font><font color="4444FF">;</font> <font color="#2040a0">i</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line173"> 173</a>       <font color="#2040a0">F</font><font color="4444FF">[</font><font color="#2040a0">i</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#2040a0">h2_4</font><font color="4444FF">;</font>
<a name="line174"> 174</a> <font color="4444FF"><strong>}</strong></font>
<a name="line175"> 175</a> 
<a name="line176"> 176</a> 
<a name="line177"> 177</a> <strong>int</strong> <font color="#2040a0">main</font> <font color="4444FF">(</font><strong>int</strong> <font color="#2040a0">argc</font>, <strong>char</strong> <font color="4444FF">*</font><font color="#2040a0">argv</font><font color="4444FF">[</font><font color="4444FF">]</font><font color="4444FF">)</font>
<a name="line178"> 178</a> <font color="4444FF"><strong>{</strong></font>
<a name="line179"> 179</a>    <strong>int</strong> <font color="#2040a0">myid</font>, <font color="#2040a0">num_procs</font><font color="4444FF">;</font>
<a name="line180"> 180</a>    <strong>int</strong> <font color="#2040a0">n</font>, <font color="#2040a0">N</font>, <font color="#2040a0">pi</font>, <font color="#2040a0">pj</font>, <font color="#2040a0">pk</font><font color="4444FF">;</font>
<a name="line181"> 181</a>    <strong>double</strong> <font color="#2040a0">h</font><font color="4444FF">;</font>
<a name="line182"> 182</a>    <strong>int</strong> <font color="#2040a0">print_solution</font><font color="4444FF">;</font>
<a name="line183"> 183</a> 
<a name="line184"> 184</a>    <strong>double</strong> <font color="#2040a0">tol</font>, <font color="#2040a0">theta</font><font color="4444FF">;</font>
<a name="line185"> 185</a>    <strong>int</strong> <font color="#2040a0">maxit</font>, <font color="#2040a0">cycle_type</font><font color="4444FF">;</font>
<a name="line186"> 186</a>    <strong>int</strong> <font color="#2040a0">rlx_type</font>, <font color="#2040a0">rlx_sweeps</font>, <font color="#2040a0">rlx_weight</font>, <font color="#2040a0">rlx_omega</font><font color="4444FF">;</font>
<a name="line187"> 187</a>    <strong>int</strong> <font color="#2040a0">amg_coarsen_type</font>, <font color="#2040a0">amg_agg_levels</font>, <font color="#2040a0">amg_rlx_type</font><font color="4444FF">;</font>
<a name="line188"> 188</a>    <strong>int</strong> <font color="#2040a0">amg_interp_type</font>, <font color="#2040a0">amg_Pmax</font><font color="4444FF">;</font>
<a name="line189"> 189</a>    <strong>int</strong> <font color="#2040a0">singular_problem</font> <font color="4444FF">;</font>
<a name="line190"> 190</a> 
<a name="line191"> 191</a>    <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">time_index</font><font color="4444FF">;</font>
<a name="line192"> 192</a> 
<a name="line193"> 193</a>    <font color="#2040a0">HYPRE_SStructGrid</font>     <font color="#2040a0">edge_grid</font><font color="4444FF">;</font>
<a name="line194"> 194</a>    <font color="#2040a0">HYPRE_SStructGraph</font>    <font color="#2040a0">A_graph</font><font color="4444FF">;</font>
<a name="line195"> 195</a>    <font color="#2040a0">HYPRE_SStructMatrix</font>   <font color="#2040a0">A</font><font color="4444FF">;</font>
<a name="line196"> 196</a>    <font color="#2040a0">HYPRE_SStructVector</font>   <font color="#2040a0">b</font><font color="4444FF">;</font>
<a name="line197"> 197</a>    <font color="#2040a0">HYPRE_SStructVector</font>   <font color="#2040a0">x</font><font color="4444FF">;</font>
<a name="line198"> 198</a>    <font color="#2040a0">HYPRE_SStructGrid</font>     <font color="#2040a0">node_grid</font><font color="4444FF">;</font>
<a name="line199"> 199</a>    <font color="#2040a0">HYPRE_SStructGraph</font>    <font color="#2040a0">G_graph</font><font color="4444FF">;</font>
<a name="line200"> 200</a>    <font color="#2040a0">HYPRE_SStructStencil</font>  <font color="#2040a0">G_stencil</font><font color="4444FF">[</font><font color="#FF0000">3</font><font color="4444FF">]</font><font color="4444FF">;</font>
<a name="line201"> 201</a>    <font color="#2040a0">HYPRE_SStructMatrix</font>   <font color="#2040a0">G</font><font color="4444FF">;</font>
<a name="line202"> 202</a>    <font color="#2040a0">HYPRE_SStructVector</font>   <font color="#2040a0">xcoord</font>, <font color="#2040a0">ycoord</font>, <font color="#2040a0">zcoord</font><font color="4444FF">;</font>
<a name="line203"> 203</a> 
<a name="line204"> 204</a>    <font color="#2040a0">HYPRE_Solver</font>          <font color="#2040a0">solver</font>, <font color="#2040a0">precond</font><font color="4444FF">;</font>
<a name="line205"> 205</a> 
<a name="line206"> 206</a>    <font color="#444444">/* Initialize MPI */</font>
<a name="line207"> 207</a>    <font color="#2040a0">MPI_Init</font><font color="4444FF">(</font><font color="4444FF">&amp;</font><font color="#2040a0">argc</font>, <font color="4444FF">&amp;</font><font color="#2040a0">argv</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line208"> 208</a>    <font color="#2040a0">MPI_Comm_rank</font><font color="4444FF">(</font><font color="#2040a0">MPI_COMM_WORLD</font>, <font color="4444FF">&amp;</font><font color="#2040a0">myid</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line209"> 209</a>    <font color="#2040a0">MPI_Comm_size</font><font color="4444FF">(</font><font color="#2040a0">MPI_COMM_WORLD</font>, <font color="4444FF">&amp;</font><font color="#2040a0">num_procs</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line210"> 210</a> 
<a name="line211"> 211</a>    <font color="#444444">/* Set default parameters */</font>
<a name="line212"> 212</a>    <font color="#2040a0">n</font>                <font color="4444FF">=</font> <font color="#FF0000">10</font><font color="4444FF">;</font>
<a name="line213"> 213</a>    <font color="#2040a0">print_solution</font>   <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font>
<a name="line214"> 214</a>    <font color="#2040a0">optionAlpha</font>      <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font>
<a name="line215"> 215</a>    <font color="#2040a0">optionBeta</font>       <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font>
<a name="line216"> 216</a>    <font color="#2040a0">maxit</font>            <font color="4444FF">=</font> <font color="#FF0000">100</font><font color="4444FF">;</font>
<a name="line217"> 217</a>    <font color="#2040a0">tol</font>              <font color="4444FF">=</font> <font color="#FF0000">1e-6</font><font color="4444FF">;</font>
<a name="line218"> 218</a>    <font color="#2040a0">cycle_type</font>       <font color="4444FF">=</font> <font color="#FF0000">13</font><font color="4444FF">;</font>
<a name="line219"> 219</a>    <font color="#2040a0">rlx_type</font>         <font color="4444FF">=</font> <font color="#FF0000">2</font><font color="4444FF">;</font>
<a name="line220"> 220</a>    <font color="#2040a0">rlx_sweeps</font>       <font color="4444FF">=</font> <font color="#FF0000">1</font><font color="4444FF">;</font>
<a name="line221"> 221</a>    <font color="#2040a0">rlx_weight</font>       <font color="4444FF">=</font> <font color="#FF0000">1.0</font><font color="4444FF">;</font>
<a name="line222"> 222</a>    <font color="#2040a0">rlx_omega</font>        <font color="4444FF">=</font> <font color="#FF0000">1.0</font><font color="4444FF">;</font>
<a name="line223"> 223</a>    <font color="#2040a0">amg_coarsen_type</font> <font color="4444FF">=</font> <font color="#FF0000">10</font><font color="4444FF">;</font>
<a name="line224"> 224</a>    <font color="#2040a0">amg_agg_levels</font>   <font color="4444FF">=</font> <font color="#FF0000">1</font><font color="4444FF">;</font>
<a name="line225"> 225</a>    <font color="#2040a0">amg_rlx_type</font>     <font color="4444FF">=</font> <font color="#FF0000">6</font><font color="4444FF">;</font>
<a name="line226"> 226</a>    <font color="#2040a0">theta</font>            <font color="4444FF">=</font> <font color="#FF0000">0.25</font><font color="4444FF">;</font>
<a name="line227"> 227</a>    <font color="#2040a0">amg_interp_type</font>  <font color="4444FF">=</font> <font color="#FF0000">6</font><font color="4444FF">;</font>
<a name="line228"> 228</a>    <font color="#2040a0">amg_Pmax</font>         <font color="4444FF">=</font> <font color="#FF0000">4</font><font color="4444FF">;</font>
<a name="line229"> 229</a>    <font color="#2040a0">singular_problem</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font>
<a name="line230"> 230</a> 
<a name="line231"> 231</a>    <font color="#444444">/* Parse command line */</font>
<a name="line232"> 232</a>    <font color="4444FF"><strong>{</strong></font>
<a name="line233"> 233</a>       <strong>int</strong> <font color="#2040a0">arg_index</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font>
<a name="line234"> 234</a>       <strong>int</strong> <font color="#2040a0">print_usage</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font>
<a name="line235"> 235</a> 
<a name="line236"> 236</a>       <strong>while</strong> <font color="4444FF">(</font><font color="#2040a0">arg_index</font> <font color="4444FF">&lt;</font> <font color="#2040a0">argc</font><font color="4444FF">)</font>
<a name="line237"> 237</a>       <font color="4444FF"><strong>{</strong></font>
<a name="line238"> 238</a>          <strong>if</strong> <font color="4444FF">(</font> <font color="#2040a0">strcmp</font><font color="4444FF">(</font><font color="#2040a0">argv</font><font color="4444FF">[</font><font color="#2040a0">arg_index</font><font color="4444FF">]</font>, <font color="#008000">&quot;-n&quot;</font><font color="4444FF">)</font> <font color="4444FF">=</font><font color="4444FF">=</font> <font color="#FF0000">0</font> <font color="4444FF">)</font>
<a name="line239"> 239</a>          <font color="4444FF"><strong>{</strong></font>
<a name="line240"> 240</a>             <font color="#2040a0">arg_index</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">;</font>
<a name="line241"> 241</a>             <font color="#2040a0">n</font> <font color="4444FF">=</font> <font color="#2040a0">atoi</font><font color="4444FF">(</font><font color="#2040a0">argv</font><font color="4444FF">[</font><font color="#2040a0">arg_index</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">]</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line242"> 242</a>          <font color="4444FF"><strong>}</strong></font>
<a name="line243"> 243</a>          <strong>else</strong> <strong>if</strong> <font color="4444FF">(</font> <font color="#2040a0">strcmp</font><font color="4444FF">(</font><font color="#2040a0">argv</font><font color="4444FF">[</font><font color="#2040a0">arg_index</font><font color="4444FF">]</font>, <font color="#008000">&quot;-a&quot;</font><font color="4444FF">)</font> <font color="4444FF">=</font><font color="4444FF">=</font> <font color="#FF0000">0</font> <font color="4444FF">)</font>
<a name="line244"> 244</a>          <font color="4444FF"><strong>{</strong></font>
<a name="line245"> 245</a>             <font color="#2040a0">arg_index</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">;</font>
<a name="line246"> 246</a>             <font color="#2040a0">optionAlpha</font> <font color="4444FF">=</font> <font color="#2040a0">atoi</font><font color="4444FF">(</font><font color="#2040a0">argv</font><font color="4444FF">[</font><font color="#2040a0">arg_index</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">]</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line247"> 247</a>          <font color="4444FF"><strong>}</strong></font>
<a name="line248"> 248</a>          <strong>else</strong> <strong>if</strong> <font color="4444FF">(</font> <font color="#2040a0">strcmp</font><font color="4444FF">(</font><font color="#2040a0">argv</font><font color="4444FF">[</font><font color="#2040a0">arg_index</font><font color="4444FF">]</font>, <font color="#008000">&quot;-b&quot;</font><font color="4444FF">)</font> <font color="4444FF">=</font><font color="4444FF">=</font> <font color="#FF0000">0</font> <font color="4444FF">)</font>
<a name="line249"> 249</a>          <font color="4444FF"><strong>{</strong></font>
<a name="line250"> 250</a>             <font color="#2040a0">arg_index</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">;</font>
<a name="line251"> 251</a>             <font color="#2040a0">optionBeta</font> <font color="4444FF">=</font> <font color="#2040a0">atoi</font><font color="4444FF">(</font><font color="#2040a0">argv</font><font color="4444FF">[</font><font color="#2040a0">arg_index</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">]</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line252"> 252</a>          <font color="4444FF"><strong>}</strong></font>
<a name="line253"> 253</a>          <strong>else</strong> <strong>if</strong> <font color="4444FF">(</font> <font color="#2040a0">strcmp</font><font color="4444FF">(</font><font color="#2040a0">argv</font><font color="4444FF">[</font><font color="#2040a0">arg_index</font><font color="4444FF">]</font>, <font color="#008000">&quot;-print_solution&quot;</font><font color="4444FF">)</font> <font color="4444FF">=</font><font color="4444FF">=</font> <font color="#FF0000">0</font> <font color="4444FF">)</font>
<a name="line254"> 254</a>          <font color="4444FF"><strong>{</strong></font>
<a name="line255"> 255</a>             <font color="#2040a0">arg_index</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">;</font>
<a name="line256"> 256</a>             <font color="#2040a0">print_solution</font> <font color="4444FF">=</font> <font color="#FF0000">1</font><font color="4444FF">;</font>
<a name="line257"> 257</a>          <font color="4444FF"><strong>}</strong></font>
<a name="line258"> 258</a>          <strong>else</strong> <strong>if</strong> <font color="4444FF">(</font> <font color="#2040a0">strcmp</font><font color="4444FF">(</font><font color="#2040a0">argv</font><font color="4444FF">[</font><font color="#2040a0">arg_index</font><font color="4444FF">]</font>, <font color="#008000">&quot;-maxit&quot;</font><font color="4444FF">)</font> <font color="4444FF">=</font><font color="4444FF">=</font> <font color="#FF0000">0</font> <font color="4444FF">)</font>
<a name="line259"> 259</a>          <font color="4444FF"><strong>{</strong></font>
<a name="line260"> 260</a>             <font color="#2040a0">arg_index</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">;</font>
<a name="line261"> 261</a>             <font color="#2040a0">maxit</font> <font color="4444FF">=</font> <font color="#2040a0">atoi</font><font color="4444FF">(</font><font color="#2040a0">argv</font><font color="4444FF">[</font><font color="#2040a0">arg_index</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">]</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line262"> 262</a>          <font color="4444FF"><strong>}</strong></font>
<a name="line263"> 263</a>          <strong>else</strong> <strong>if</strong> <font color="4444FF">(</font> <font color="#2040a0">strcmp</font><font color="4444FF">(</font><font color="#2040a0">argv</font><font color="4444FF">[</font><font color="#2040a0">arg_index</font><font color="4444FF">]</font>, <font color="#008000">&quot;-tol&quot;</font><font color="4444FF">)</font> <font color="4444FF">=</font><font color="4444FF">=</font> <font color="#FF0000">0</font> <font color="4444FF">)</font>
<a name="line264"> 264</a>          <font color="4444FF"><strong>{</strong></font>
<a name="line265"> 265</a>             <font color="#2040a0">arg_index</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">;</font>
<a name="line266"> 266</a>             <font color="#2040a0">tol</font> <font color="4444FF">=</font> <font color="#2040a0">atof</font><font color="4444FF">(</font><font color="#2040a0">argv</font><font color="4444FF">[</font><font color="#2040a0">arg_index</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">]</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line267"> 267</a>          <font color="4444FF"><strong>}</strong></font>
<a name="line268"> 268</a>          <strong>else</strong> <strong>if</strong> <font color="4444FF">(</font> <font color="#2040a0">strcmp</font><font color="4444FF">(</font><font color="#2040a0">argv</font><font color="4444FF">[</font><font color="#2040a0">arg_index</font><font color="4444FF">]</font>, <font color="#008000">&quot;-type&quot;</font><font color="4444FF">)</font> <font color="4444FF">=</font><font color="4444FF">=</font> <font color="#FF0000">0</font> <font color="4444FF">)</font>
<a name="line269"> 269</a>          <font color="4444FF"><strong>{</strong></font>
<a name="line270"> 270</a>             <font color="#2040a0">arg_index</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">;</font>
<a name="line271"> 271</a>             <font color="#2040a0">cycle_type</font> <font color="4444FF">=</font> <font color="#2040a0">atoi</font><font color="4444FF">(</font><font color="#2040a0">argv</font><font color="4444FF">[</font><font color="#2040a0">arg_index</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">]</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line272"> 272</a>          <font color="4444FF"><strong>}</strong></font>
<a name="line273"> 273</a>          <strong>else</strong> <strong>if</strong> <font color="4444FF">(</font> <font color="#2040a0">strcmp</font><font color="4444FF">(</font><font color="#2040a0">argv</font><font color="4444FF">[</font><font color="#2040a0">arg_index</font><font color="4444FF">]</font>, <font color="#008000">&quot;-rlx&quot;</font><font color="4444FF">)</font> <font color="4444FF">=</font><font color="4444FF">=</font> <font color="#FF0000">0</font> <font color="4444FF">)</font>
<a name="line274"> 274</a>          <font color="4444FF"><strong>{</strong></font>
<a name="line275"> 275</a>             <font color="#2040a0">arg_index</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">;</font>
<a name="line276"> 276</a>             <font color="#2040a0">rlx_type</font> <font color="4444FF">=</font> <font color="#2040a0">atoi</font><font color="4444FF">(</font><font color="#2040a0">argv</font><font color="4444FF">[</font><font color="#2040a0">arg_index</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">]</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line277"> 277</a>          <font color="4444FF"><strong>}</strong></font>
<a name="line278"> 278</a>          <strong>else</strong> <strong>if</strong> <font color="4444FF">(</font> <font color="#2040a0">strcmp</font><font color="4444FF">(</font><font color="#2040a0">argv</font><font color="4444FF">[</font><font color="#2040a0">arg_index</font><font color="4444FF">]</font>, <font color="#008000">&quot;-rlxn&quot;</font><font color="4444FF">)</font> <font color="4444FF">=</font><font color="4444FF">=</font> <font color="#FF0000">0</font> <font color="4444FF">)</font>
<a name="line279"> 279</a>          <font color="4444FF"><strong>{</strong></font>
<a name="line280"> 280</a>             <font color="#2040a0">arg_index</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">;</font>
<a name="line281"> 281</a>             <font color="#2040a0">rlx_sweeps</font> <font color="4444FF">=</font> <font color="#2040a0">atoi</font><font color="4444FF">(</font><font color="#2040a0">argv</font><font color="4444FF">[</font><font color="#2040a0">arg_index</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">]</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line282"> 282</a>          <font color="4444FF"><strong>}</strong></font>
<a name="line283"> 283</a>          <strong>else</strong> <strong>if</strong> <font color="4444FF">(</font> <font color="#2040a0">strcmp</font><font color="4444FF">(</font><font color="#2040a0">argv</font><font color="4444FF">[</font><font color="#2040a0">arg_index</font><font color="4444FF">]</font>, <font color="#008000">&quot;-rlxw&quot;</font><font color="4444FF">)</font> <font color="4444FF">=</font><font color="4444FF">=</font> <font color="#FF0000">0</font> <font color="4444FF">)</font>
<a name="line284"> 284</a>          <font color="4444FF"><strong>{</strong></font>
<a name="line285"> 285</a>             <font color="#2040a0">arg_index</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">;</font>
<a name="line286"> 286</a>             <font color="#2040a0">rlx_weight</font> <font color="4444FF">=</font> <font color="#2040a0">atof</font><font color="4444FF">(</font><font color="#2040a0">argv</font><font color="4444FF">[</font><font color="#2040a0">arg_index</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">]</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line287"> 287</a>          <font color="4444FF"><strong>}</strong></font>
<a name="line288"> 288</a>          <strong>else</strong> <strong>if</strong> <font color="4444FF">(</font> <font color="#2040a0">strcmp</font><font color="4444FF">(</font><font color="#2040a0">argv</font><font color="4444FF">[</font><font color="#2040a0">arg_index</font><font color="4444FF">]</font>, <font color="#008000">&quot;-rlxo&quot;</font><font color="4444FF">)</font> <font color="4444FF">=</font><font color="4444FF">=</font> <font color="#FF0000">0</font> <font color="4444FF">)</font>
<a name="line289"> 289</a>          <font color="4444FF"><strong>{</strong></font>
<a name="line290"> 290</a>             <font color="#2040a0">arg_index</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">;</font>
<a name="line291"> 291</a>             <font color="#2040a0">rlx_omega</font> <font color="4444FF">=</font> <font color="#2040a0">atof</font><font color="4444FF">(</font><font color="#2040a0">argv</font><font color="4444FF">[</font><font color="#2040a0">arg_index</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">]</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line292"> 292</a>          <font color="4444FF"><strong>}</strong></font>
<a name="line293"> 293</a>          <strong>else</strong> <strong>if</strong> <font color="4444FF">(</font> <font color="#2040a0">strcmp</font><font color="4444FF">(</font><font color="#2040a0">argv</font><font color="4444FF">[</font><font color="#2040a0">arg_index</font><font color="4444FF">]</font>, <font color="#008000">&quot;-ctype&quot;</font><font color="4444FF">)</font> <font color="4444FF">=</font><font color="4444FF">=</font> <font color="#FF0000">0</font> <font color="4444FF">)</font>
<a name="line294"> 294</a>          <font color="4444FF"><strong>{</strong></font>
<a name="line295"> 295</a>             <font color="#2040a0">arg_index</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">;</font>
<a name="line296"> 296</a>             <font color="#2040a0">amg_coarsen_type</font> <font color="4444FF">=</font> <font color="#2040a0">atoi</font><font color="4444FF">(</font><font color="#2040a0">argv</font><font color="4444FF">[</font><font color="#2040a0">arg_index</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">]</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line297"> 297</a>          <font color="4444FF"><strong>}</strong></font>
<a name="line298"> 298</a>          <strong>else</strong> <strong>if</strong> <font color="4444FF">(</font> <font color="#2040a0">strcmp</font><font color="4444FF">(</font><font color="#2040a0">argv</font><font color="4444FF">[</font><font color="#2040a0">arg_index</font><font color="4444FF">]</font>, <font color="#008000">&quot;-amgrlx&quot;</font><font color="4444FF">)</font> <font color="4444FF">=</font><font color="4444FF">=</font> <font color="#FF0000">0</font> <font color="4444FF">)</font>
<a name="line299"> 299</a>          <font color="4444FF"><strong>{</strong></font>
<a name="line300"> 300</a>             <font color="#2040a0">arg_index</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">;</font>
<a name="line301"> 301</a>             <font color="#2040a0">amg_rlx_type</font> <font color="4444FF">=</font> <font color="#2040a0">atoi</font><font color="4444FF">(</font><font color="#2040a0">argv</font><font color="4444FF">[</font><font color="#2040a0">arg_index</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">]</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line302"> 302</a>          <font color="4444FF"><strong>}</strong></font>
<a name="line303"> 303</a>          <strong>else</strong> <strong>if</strong> <font color="4444FF">(</font> <font color="#2040a0">strcmp</font><font color="4444FF">(</font><font color="#2040a0">argv</font><font color="4444FF">[</font><font color="#2040a0">arg_index</font><font color="4444FF">]</font>, <font color="#008000">&quot;-agg&quot;</font><font color="4444FF">)</font> <font color="4444FF">=</font><font color="4444FF">=</font> <font color="#FF0000">0</font> <font color="4444FF">)</font>
<a name="line304"> 304</a>          <font color="4444FF"><strong>{</strong></font>
<a name="line305"> 305</a>             <font color="#2040a0">arg_index</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">;</font>
<a name="line306"> 306</a>             <font color="#2040a0">amg_agg_levels</font> <font color="4444FF">=</font> <font color="#2040a0">atoi</font><font color="4444FF">(</font><font color="#2040a0">argv</font><font color="4444FF">[</font><font color="#2040a0">arg_index</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">]</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line307"> 307</a>          <font color="4444FF"><strong>}</strong></font>
<a name="line308"> 308</a>          <strong>else</strong> <strong>if</strong> <font color="4444FF">(</font> <font color="#2040a0">strcmp</font><font color="4444FF">(</font><font color="#2040a0">argv</font><font color="4444FF">[</font><font color="#2040a0">arg_index</font><font color="4444FF">]</font>, <font color="#008000">&quot;-itype&quot;</font><font color="4444FF">)</font> <font color="4444FF">=</font><font color="4444FF">=</font> <font color="#FF0000">0</font> <font color="4444FF">)</font>
<a name="line309"> 309</a>          <font color="4444FF"><strong>{</strong></font>
<a name="line310"> 310</a>             <font color="#2040a0">arg_index</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">;</font>
<a name="line311"> 311</a>             <font color="#2040a0">amg_interp_type</font> <font color="4444FF">=</font> <font color="#2040a0">atoi</font><font color="4444FF">(</font><font color="#2040a0">argv</font><font color="4444FF">[</font><font color="#2040a0">arg_index</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">]</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line312"> 312</a>          <font color="4444FF"><strong>}</strong></font>
<a name="line313"> 313</a>          <strong>else</strong> <strong>if</strong> <font color="4444FF">(</font> <font color="#2040a0">strcmp</font><font color="4444FF">(</font><font color="#2040a0">argv</font><font color="4444FF">[</font><font color="#2040a0">arg_index</font><font color="4444FF">]</font>, <font color="#008000">&quot;-pmax&quot;</font><font color="4444FF">)</font> <font color="4444FF">=</font><font color="4444FF">=</font> <font color="#FF0000">0</font> <font color="4444FF">)</font>
<a name="line314"> 314</a>          <font color="4444FF"><strong>{</strong></font>
<a name="line315"> 315</a>             <font color="#2040a0">arg_index</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">;</font>
<a name="line316"> 316</a>             <font color="#2040a0">amg_Pmax</font> <font color="4444FF">=</font> <font color="#2040a0">atoi</font><font color="4444FF">(</font><font color="#2040a0">argv</font><font color="4444FF">[</font><font color="#2040a0">arg_index</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">]</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line317"> 317</a>          <font color="4444FF"><strong>}</strong></font>
<a name="line318"> 318</a>          <strong>else</strong> <strong>if</strong> <font color="4444FF">(</font> <font color="#2040a0">strcmp</font><font color="4444FF">(</font><font color="#2040a0">argv</font><font color="4444FF">[</font><font color="#2040a0">arg_index</font><font color="4444FF">]</font>, <font color="#008000">&quot;-sing&quot;</font><font color="4444FF">)</font> <font color="4444FF">=</font><font color="4444FF">=</font> <font color="#FF0000">0</font> <font color="4444FF">)</font>
<a name="line319"> 319</a>          <font color="4444FF"><strong>{</strong></font>
<a name="line320"> 320</a>             <font color="#2040a0">arg_index</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">;</font>
<a name="line321"> 321</a>             <font color="#2040a0">singular_problem</font> <font color="4444FF">=</font> <font color="#FF0000">1</font><font color="4444FF">;</font>
<a name="line322"> 322</a>          <font color="4444FF"><strong>}</strong></font>
<a name="line323"> 323</a>          <strong>else</strong> <strong>if</strong> <font color="4444FF">(</font> <font color="#2040a0">strcmp</font><font color="4444FF">(</font><font color="#2040a0">argv</font><font color="4444FF">[</font><font color="#2040a0">arg_index</font><font color="4444FF">]</font>, <font color="#008000">&quot;-theta&quot;</font><font color="4444FF">)</font> <font color="4444FF">=</font><font color="4444FF">=</font> <font color="#FF0000">0</font> <font color="4444FF">)</font>
<a name="line324"> 324</a>          <font color="4444FF"><strong>{</strong></font>
<a name="line325"> 325</a>             <font color="#2040a0">arg_index</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">;</font>
<a name="line326"> 326</a>             <font color="#2040a0">theta</font> <font color="4444FF">=</font> <font color="#2040a0">atof</font><font color="4444FF">(</font><font color="#2040a0">argv</font><font color="4444FF">[</font><font color="#2040a0">arg_index</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">]</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line327"> 327</a>          <font color="4444FF"><strong>}</strong></font>
<a name="line328"> 328</a> 
<a name="line329"> 329</a>          <strong>else</strong> <strong>if</strong> <font color="4444FF">(</font> <font color="#2040a0">strcmp</font><font color="4444FF">(</font><font color="#2040a0">argv</font><font color="4444FF">[</font><font color="#2040a0">arg_index</font><font color="4444FF">]</font>, <font color="#008000">&quot;-help&quot;</font><font color="4444FF">)</font> <font color="4444FF">=</font><font color="4444FF">=</font> <font color="#FF0000">0</font> <font color="4444FF">)</font>
<a name="line330"> 330</a>          <font color="4444FF"><strong>{</strong></font>
<a name="line331"> 331</a>             <font color="#2040a0">print_usage</font> <font color="4444FF">=</font> <font color="#FF0000">1</font><font color="4444FF">;</font>
<a name="line332"> 332</a>             <strong>break</strong><font color="4444FF">;</font>
<a name="line333"> 333</a>          <font color="4444FF"><strong>}</strong></font>
<a name="line334"> 334</a>          <strong>else</strong>
<a name="line335"> 335</a>          <font color="4444FF"><strong>{</strong></font>
<a name="line336"> 336</a>             <font color="#2040a0">arg_index</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">;</font>
<a name="line337"> 337</a>          <font color="4444FF"><strong>}</strong></font>
<a name="line338"> 338</a>       <font color="4444FF"><strong>}</strong></font>
<a name="line339"> 339</a> 
<a name="line340"> 340</a>       <strong>if</strong> <font color="4444FF">(</font><font color="4444FF">(</font><font color="#2040a0">print_usage</font><font color="4444FF">)</font> <font color="4444FF">&amp;</font><font color="4444FF">&amp;</font> <font color="4444FF">(</font><font color="#2040a0">myid</font> <font color="4444FF">=</font><font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">)</font><font color="4444FF">)</font>
<a name="line341"> 341</a>       <font color="4444FF"><strong>{</strong></font>
<a name="line342"> 342</a>          <font color="#2040a0">printf</font><font color="4444FF">(</font><font color="#008000">&quot;<font color="#77dd77">\n</font>&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line343"> 343</a>          <font color="#2040a0">printf</font><font color="4444FF">(</font><font color="#008000">&quot;Usage: %s [&lt;options&gt;]<font color="#77dd77">\n</font>&quot;</font>, <font color="#2040a0">argv</font><font color="4444FF">[</font><font color="#FF0000">0</font><font color="4444FF">]</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line344"> 344</a>          <font color="#2040a0">printf</font><font color="4444FF">(</font><font color="#008000">&quot;<font color="#77dd77">\n</font>&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line345"> 345</a>          <font color="#2040a0">printf</font><font color="4444FF">(</font><font color="#008000">&quot;  -n &lt;n&gt;              : problem size per processor (default: 10)<font color="#77dd77">\n</font>&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line346"> 346</a>          <font color="#2040a0">printf</font><font color="4444FF">(</font><font color="#008000">&quot;  -a &lt;alpha_opt&gt;      : choice for the curl-curl coefficient (default: 1.0)<font color="#77dd77">\n</font>&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line347"> 347</a>          <font color="#2040a0">printf</font><font color="4444FF">(</font><font color="#008000">&quot;  -b &lt;beta_opt&gt;       : choice for the mass coefficient (default: 1.0)<font color="#77dd77">\n</font>&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line348"> 348</a>          <font color="#2040a0">printf</font><font color="4444FF">(</font><font color="#008000">&quot;  -print_solution     : print the solution vector<font color="#77dd77">\n</font>&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line349"> 349</a>          <font color="#2040a0">printf</font><font color="4444FF">(</font><font color="#008000">&quot;<font color="#77dd77">\n</font>&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line350"> 350</a>          <font color="#2040a0">printf</font><font color="4444FF">(</font><font color="#008000">&quot;PCG-AMS solver options:                                     <font color="#77dd77">\n</font>&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line351"> 351</a>          <font color="#2040a0">printf</font><font color="4444FF">(</font><font color="#008000">&quot;  -maxit &lt;num&gt;        : maximum number of iterations (100)  <font color="#77dd77">\n</font>&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line352"> 352</a>          <font color="#2040a0">printf</font><font color="4444FF">(</font><font color="#008000">&quot;  -tol &lt;num&gt;          : convergence tolerance (1e-6)        <font color="#77dd77">\n</font>&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line353"> 353</a>          <font color="#2040a0">printf</font><font color="4444FF">(</font><font color="#008000">&quot;  -type &lt;num&gt;         : 3-level cycle type (0-8, 11-14)     <font color="#77dd77">\n</font>&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line354"> 354</a>          <font color="#2040a0">printf</font><font color="4444FF">(</font><font color="#008000">&quot;  -theta &lt;num&gt;        : BoomerAMG threshold (0.25)          <font color="#77dd77">\n</font>&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line355"> 355</a>          <font color="#2040a0">printf</font><font color="4444FF">(</font><font color="#008000">&quot;  -ctype &lt;num&gt;        : BoomerAMG coarsening type           <font color="#77dd77">\n</font>&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line356"> 356</a>          <font color="#2040a0">printf</font><font color="4444FF">(</font><font color="#008000">&quot;  -agg &lt;num&gt;          : Levels of BoomerAMG agg. coarsening <font color="#77dd77">\n</font>&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line357"> 357</a>          <font color="#2040a0">printf</font><font color="4444FF">(</font><font color="#008000">&quot;  -amgrlx &lt;num&gt;       : BoomerAMG relaxation type           <font color="#77dd77">\n</font>&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line358"> 358</a>          <font color="#2040a0">printf</font><font color="4444FF">(</font><font color="#008000">&quot;  -itype &lt;num&gt;        : BoomerAMG interpolation type        <font color="#77dd77">\n</font>&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line359"> 359</a>          <font color="#2040a0">printf</font><font color="4444FF">(</font><font color="#008000">&quot;  -pmax &lt;num&gt;         : BoomerAMG interpolation truncation  <font color="#77dd77">\n</font>&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line360"> 360</a>          <font color="#2040a0">printf</font><font color="4444FF">(</font><font color="#008000">&quot;  -rlx &lt;num&gt;          : relaxation type                     <font color="#77dd77">\n</font>&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line361"> 361</a>          <font color="#2040a0">printf</font><font color="4444FF">(</font><font color="#008000">&quot;  -rlxn &lt;num&gt;         : number of relaxation sweeps         <font color="#77dd77">\n</font>&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line362"> 362</a>          <font color="#2040a0">printf</font><font color="4444FF">(</font><font color="#008000">&quot;  -rlxw &lt;num&gt;         : damping parameter (usually &lt;=1)     <font color="#77dd77">\n</font>&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line363"> 363</a>          <font color="#2040a0">printf</font><font color="4444FF">(</font><font color="#008000">&quot;  -rlxo &lt;num&gt;         : SOR parameter (usually in (0,2))    <font color="#77dd77">\n</font>&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line364"> 364</a>          <font color="#2040a0">printf</font><font color="4444FF">(</font><font color="#008000">&quot;  -sing               : curl-curl only (singular) problem   <font color="#77dd77">\n</font>&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line365"> 365</a>          <font color="#2040a0">printf</font><font color="4444FF">(</font><font color="#008000">&quot;<font color="#77dd77">\n</font>&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line366"> 366</a>          <font color="#2040a0">printf</font><font color="4444FF">(</font><font color="#008000">&quot;<font color="#77dd77">\n</font>&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line367"> 367</a>       <font color="4444FF"><strong>}</strong></font>
<a name="line368"> 368</a> 
<a name="line369"> 369</a>       <strong>if</strong> <font color="4444FF">(</font><font color="#2040a0">print_usage</font><font color="4444FF">)</font>
<a name="line370"> 370</a>       <font color="4444FF"><strong>{</strong></font>
<a name="line371"> 371</a>          <font color="#2040a0">MPI_Finalize</font><font color="4444FF">(</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line372"> 372</a>          <strong>return</strong> <font color="4444FF">(</font><font color="#FF0000">0</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line373"> 373</a>       <font color="4444FF"><strong>}</strong></font>
<a name="line374"> 374</a>    <font color="4444FF"><strong>}</strong></font>
<a name="line375"> 375</a> 
<a name="line376"> 376</a>    <font color="#444444">/* Figure out the processor grid (N x N x N).  The local problem size is n^3,
<a name="line377"> 377</a>       while pi, pj and pk indicate the position in the processor grid. */</font>
<a name="line378"> 378</a>    <font color="#2040a0">N</font>  <font color="4444FF">=</font> <font color="#2040a0">pow</font><font color="4444FF">(</font><font color="#2040a0">num_procs</font>,<font color="#FF0000">1.0</font>/<font color="#FF0000">3.0</font><font color="4444FF">)</font> <font color="4444FF">+</font> <font color="#FF0000">0.5</font><font color="4444FF">;</font>
<a name="line379"> 379</a>    <strong>if</strong> <font color="4444FF">(</font><font color="#2040a0">num_procs</font> <font color="4444FF">!</font><font color="4444FF">=</font> <font color="#2040a0">N</font><font color="4444FF">*</font><font color="#2040a0">N</font><font color="4444FF">*</font><font color="#2040a0">N</font><font color="4444FF">)</font>
<a name="line380"> 380</a>    <font color="4444FF"><strong>{</strong></font>
<a name="line381"> 381</a>       <strong>if</strong> <font color="4444FF">(</font><font color="#2040a0">myid</font> <font color="4444FF">=</font><font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">)</font> <font color="#2040a0">printf</font><font color="4444FF">(</font><font color="#008000">&quot;Can't run on %d processors, try %d.<font color="#77dd77">\n</font>&quot;</font>,
<a name="line382"> 382</a>                             <font color="#2040a0">num_procs</font>, <font color="#2040a0">N</font><font color="4444FF">*</font><font color="#2040a0">N</font><font color="4444FF">*</font><font color="#2040a0">N</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line383"> 383</a>       <font color="#2040a0">MPI_Finalize</font><font color="4444FF">(</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line384"> 384</a>       <font color="#2040a0">exit</font><font color="4444FF">(</font><font color="#FF0000">1</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line385"> 385</a>    <font color="4444FF"><strong>}</strong></font>
<a name="line386"> 386</a>    <font color="#2040a0">h</font>  <font color="4444FF">=</font> <font color="#FF0000">1.0</font> / <font color="4444FF">(</font><font color="#2040a0">N</font><font color="4444FF">*</font><font color="#2040a0">n</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line387"> 387</a>    <font color="#2040a0">pk</font> <font color="4444FF">=</font> <font color="#2040a0">myid</font> / <font color="4444FF">(</font><font color="#2040a0">N</font><font color="4444FF">*</font><font color="#2040a0">N</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line388"> 388</a>    <font color="#2040a0">pj</font> <font color="4444FF">=</font> <font color="#2040a0">myid</font>/<font color="#2040a0">N</font> <font color="4444FF">-</font> <font color="#2040a0">pk</font><font color="4444FF">*</font><font color="#2040a0">N</font><font color="4444FF">;</font>
<a name="line389"> 389</a>    <font color="#2040a0">pi</font> <font color="4444FF">=</font> <font color="#2040a0">myid</font> <font color="4444FF">-</font> <font color="#2040a0">pj</font><font color="4444FF">*</font><font color="#2040a0">N</font> <font color="4444FF">-</font> <font color="#2040a0">pk</font><font color="4444FF">*</font><font color="#2040a0">N</font><font color="4444FF">*</font><font color="#2040a0">N</font><font color="4444FF">;</font>
<a name="line390"> 390</a> 
<a name="line391"> 391</a>    <font color="#444444">/* Start timing */</font>
<a name="line392"> 392</a>    <font color="#2040a0">time_index</font> <font color="4444FF">=</font> <font color="#2040a0">hypre_InitializeTiming</font><font color="4444FF">(</font><font color="#008000">&quot;SStruct Setup&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line393"> 393</a>    <font color="#2040a0">hypre_BeginTiming</font><font color="4444FF">(</font><font color="#2040a0">time_index</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line394"> 394</a> 
<a name="line395"> 395</a>    <font color="#444444">/* 1. Set up the edge and nodal grids.  Note that we do this simultaneously
<a name="line396"> 396</a>          to make sure that they have the same extends.  For simplicity we use
<a name="line397"> 397</a>          only one part to represent the unit cube. */</font>
<a name="line398"> 398</a>    <font color="4444FF"><strong>{</strong></font>
<a name="line399"> 399</a>       <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">ndim</font> <font color="4444FF">=</font> <font color="#FF0000">3</font><font color="4444FF">;</font>
<a name="line400"> 400</a>       <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">nparts</font> <font color="4444FF">=</font> <font color="#FF0000">1</font><font color="4444FF">;</font>
<a name="line401"> 401</a> 
<a name="line402"> 402</a>       <font color="#444444">/* Create empty 2D grid objects */</font>
<a name="line403"> 403</a>       <font color="#2040a0">HYPRE_SStructGridCreate</font><font color="4444FF">(</font><font color="#2040a0">MPI_COMM_WORLD</font>, <font color="#2040a0">ndim</font>, <font color="#2040a0">nparts</font>, <font color="4444FF">&amp;</font><font color="#2040a0">node_grid</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line404"> 404</a>       <font color="#2040a0">HYPRE_SStructGridCreate</font><font color="4444FF">(</font><font color="#2040a0">MPI_COMM_WORLD</font>, <font color="#2040a0">ndim</font>, <font color="#2040a0">nparts</font>, <font color="4444FF">&amp;</font><font color="#2040a0">edge_grid</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line405"> 405</a> 
<a name="line406"> 406</a>       <font color="#444444">/* Set the extents of the grid - each processor sets its grid boxes. */</font>
<a name="line407"> 407</a>       <font color="4444FF"><strong>{</strong></font>
<a name="line408"> 408</a>          <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">part</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font>
<a name="line409"> 409</a>          <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">ilower</font><font color="4444FF">[</font><font color="#FF0000">3</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF"><strong>{</strong></font><font color="#FF0000">1</font> <font color="4444FF">+</font> <font color="#2040a0">pi</font><font color="4444FF">*</font><font color="#2040a0">n</font>, <font color="#FF0000">1</font> <font color="4444FF">+</font> <font color="#2040a0">pj</font><font color="4444FF">*</font><font color="#2040a0">n</font>, <font color="#FF0000">1</font> <font color="4444FF">+</font> <font color="#2040a0">pk</font><font color="4444FF">*</font><font color="#2040a0">n</font><font color="4444FF"><strong>}</strong></font><font color="4444FF">;</font>
<a name="line410"> 410</a>          <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">iupper</font><font color="4444FF">[</font><font color="#FF0000">3</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF"><strong>{</strong></font><font color="#2040a0">n</font> <font color="4444FF">+</font> <font color="#2040a0">pi</font><font color="4444FF">*</font><font color="#2040a0">n</font>, <font color="#2040a0">n</font> <font color="4444FF">+</font> <font color="#2040a0">pj</font><font color="4444FF">*</font><font color="#2040a0">n</font>, <font color="#2040a0">n</font> <font color="4444FF">+</font> <font color="#2040a0">pk</font><font color="4444FF">*</font><font color="#2040a0">n</font><font color="4444FF"><strong>}</strong></font><font color="4444FF">;</font>
<a name="line411"> 411</a> 
<a name="line412"> 412</a>          <font color="#2040a0">HYPRE_SStructGridSetExtents</font><font color="4444FF">(</font><font color="#2040a0">node_grid</font>, <font color="#2040a0">part</font>, <font color="#2040a0">ilower</font>, <font color="#2040a0">iupper</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line413"> 413</a>          <font color="#2040a0">HYPRE_SStructGridSetExtents</font><font color="4444FF">(</font><font color="#2040a0">edge_grid</font>, <font color="#2040a0">part</font>, <font color="#2040a0">ilower</font>, <font color="#2040a0">iupper</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line414"> 414</a>       <font color="4444FF"><strong>}</strong></font>
<a name="line415"> 415</a> 
<a name="line416"> 416</a>       <font color="#444444">/* Set the variable type and number of variables on each grid. */</font>
<a name="line417"> 417</a>       <font color="4444FF"><strong>{</strong></font>
<a name="line418"> 418</a>          <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">i</font><font color="4444FF">;</font>
<a name="line419"> 419</a>          <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">nnodevars</font> <font color="4444FF">=</font> <font color="#FF0000">1</font><font color="4444FF">;</font>
<a name="line420"> 420</a>          <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">nedgevars</font> <font color="4444FF">=</font> <font color="#FF0000">3</font><font color="4444FF">;</font>
<a name="line421"> 421</a> 
<a name="line422"> 422</a>          <font color="#2040a0">HYPRE_SStructVariable</font> <font color="#2040a0">nodevars</font><font color="4444FF">[</font><font color="#FF0000">1</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF"><strong>{</strong></font><font color="#2040a0">HYPRE_SSTRUCT_VARIABLE_NODE</font><font color="4444FF"><strong>}</strong></font><font color="4444FF">;</font>
<a name="line423"> 423</a>          <font color="#2040a0">HYPRE_SStructVariable</font> <font color="#2040a0">edgevars</font><font color="4444FF">[</font><font color="#FF0000">3</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF"><strong>{</strong></font><font color="#2040a0">HYPRE_SSTRUCT_VARIABLE_XEDGE</font>,
<a name="line424"> 424</a>                                               <font color="#2040a0">HYPRE_SSTRUCT_VARIABLE_YEDGE</font>,
<a name="line425"> 425</a>                                               <font color="#2040a0">HYPRE_SSTRUCT_VARIABLE_ZEDGE</font><font color="4444FF"><strong>}</strong></font><font color="4444FF">;</font>
<a name="line426"> 426</a>          <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">i</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">i</font> <font color="4444FF">&lt;</font> <font color="#2040a0">nparts</font><font color="4444FF">;</font> <font color="#2040a0">i</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line427"> 427</a>          <font color="4444FF"><strong>{</strong></font>
<a name="line428"> 428</a>             <font color="#2040a0">HYPRE_SStructGridSetVariables</font><font color="4444FF">(</font><font color="#2040a0">node_grid</font>, <font color="#2040a0">i</font>, <font color="#2040a0">nnodevars</font>, <font color="#2040a0">nodevars</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line429"> 429</a>             <font color="#2040a0">HYPRE_SStructGridSetVariables</font><font color="4444FF">(</font><font color="#2040a0">edge_grid</font>, <font color="#2040a0">i</font>, <font color="#2040a0">nedgevars</font>, <font color="#2040a0">edgevars</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line430"> 430</a>          <font color="4444FF"><strong>}</strong></font>
<a name="line431"> 431</a>       <font color="4444FF"><strong>}</strong></font>
<a name="line432"> 432</a> 
<a name="line433"> 433</a>       <font color="#444444">/* Since there is only one part, there is no need to call the
<a name="line434"> 434</a>          SetNeighborPart or SetSharedPart functions, which determine the spatial
<a name="line435"> 435</a>          relation between the parts.  See Examples 12, 13 and 14 for
<a name="line436"> 436</a>          illustrations of these calls. */</font>
<a name="line437"> 437</a> 
<a name="line438"> 438</a>       <font color="#444444">/* Now the grids are ready to be used */</font>
<a name="line439"> 439</a>       <font color="#2040a0">HYPRE_SStructGridAssemble</font><font color="4444FF">(</font><font color="#2040a0">node_grid</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line440"> 440</a>       <font color="#2040a0">HYPRE_SStructGridAssemble</font><font color="4444FF">(</font><font color="#2040a0">edge_grid</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line441"> 441</a>    <font color="4444FF"><strong>}</strong></font>
<a name="line442"> 442</a> 
<a name="line443"> 443</a>    <font color="#444444">/* 2. Create the finite element stiffness matrix A and load vector b. */</font>
<a name="line444"> 444</a>    <font color="4444FF"><strong>{</strong></font>
<a name="line445"> 445</a>       <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">part</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#444444">/* this problem has only one part */</font>
<a name="line446"> 446</a> 
<a name="line447"> 447</a>       <font color="#444444">/* Set the ordering of the variables in the finite element problem.  This
<a name="line448"> 448</a>          is done by listing the variable offset directions relative to the
<a name="line449"> 449</a>          element's center.  See the Reference Manual for more details. */</font>
<a name="line450"> 450</a>       <font color="4444FF"><strong>{</strong></font>
<a name="line451"> 451</a>          <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">ordering</font><font color="4444FF">[</font><font color="#FF0000">48</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF"><strong>{</strong></font> <font color="#FF0000">0</font>,  <font color="#FF0000">0</font>, <font color="4444FF">-</font><font color="#FF0000">1</font>, <font color="4444FF">-</font><font color="#FF0000">1</font>,    <font color="#444444">/* x-edge [0]-[1] */</font>
<a name="line452"> 452</a>                                     <font color="#FF0000">1</font>, <font color="4444FF">+</font><font color="#FF0000">1</font>,  <font color="#FF0000">0</font>, <font color="4444FF">-</font><font color="#FF0000">1</font>,    <font color="#444444">/* y-edge [1]-[2] */</font>
<a name="line453"> 453</a>          <font color="#444444">/*     [7]------[6]  */</font>    <font color="#FF0000">0</font>,  <font color="#FF0000">0</font>, <font color="4444FF">+</font><font color="#FF0000">1</font>, <font color="4444FF">-</font><font color="#FF0000">1</font>,    <font color="#444444">/* x-edge [3]-[2] */</font>
<a name="line454"> 454</a>          <font color="#444444">/*     /|       /|   */</font>    <font color="#FF0000">1</font>, <font color="4444FF">-</font><font color="#FF0000">1</font>,  <font color="#FF0000">0</font>, <font color="4444FF">-</font><font color="#FF0000">1</font>,    <font color="#444444">/* y-edge [0]-[3] */</font>
<a name="line455"> 455</a>          <font color="#444444">/*    / |      / |   */</font>    <font color="#FF0000">0</font>,  <font color="#FF0000">0</font>, <font color="4444FF">-</font><font color="#FF0000">1</font>, <font color="4444FF">+</font><font color="#FF0000">1</font>,    <font color="#444444">/* x-edge [4]-[5] */</font>
<a name="line456"> 456</a>          <font color="#444444">/*  [4]------[5] |   */</font>    <font color="#FF0000">1</font>, <font color="4444FF">+</font><font color="#FF0000">1</font>,  <font color="#FF0000">0</font>, <font color="4444FF">+</font><font color="#FF0000">1</font>,    <font color="#444444">/* y-edge [5]-[6] */</font>
<a name="line457"> 457</a>          <font color="#444444">/*   | [3]----|-[2]  */</font>    <font color="#FF0000">0</font>,  <font color="#FF0000">0</font>, <font color="4444FF">+</font><font color="#FF0000">1</font>, <font color="4444FF">+</font><font color="#FF0000">1</font>,    <font color="#444444">/* x-edge [7]-[6] */</font>
<a name="line458"> 458</a>          <font color="#444444">/*   | /      | /    */</font>    <font color="#FF0000">1</font>, <font color="4444FF">-</font><font color="#FF0000">1</font>,  <font color="#FF0000">0</font>, <font color="4444FF">+</font><font color="#FF0000">1</font>,    <font color="#444444">/* y-edge [4]-[7] */</font>
<a name="line459"> 459</a>          <font color="#444444">/*   |/       |/     */</font>    <font color="#FF0000">2</font>, <font color="4444FF">-</font><font color="#FF0000">1</font>, <font color="4444FF">-</font><font color="#FF0000">1</font>,  <font color="#FF0000">0</font>,    <font color="#444444">/* z-edge [0]-[4] */</font>
<a name="line460"> 460</a>          <font color="#444444">/*  [0]------[1]     */</font>    <font color="#FF0000">2</font>, <font color="4444FF">+</font><font color="#FF0000">1</font>, <font color="4444FF">-</font><font color="#FF0000">1</font>,  <font color="#FF0000">0</font>,    <font color="#444444">/* z-edge [1]-[5] */</font>
<a name="line461"> 461</a>                                     <font color="#FF0000">2</font>, <font color="4444FF">+</font><font color="#FF0000">1</font>, <font color="4444FF">+</font><font color="#FF0000">1</font>,  <font color="#FF0000">0</font>,    <font color="#444444">/* z-edge [2]-[6] */</font>
<a name="line462"> 462</a>                                     <font color="#FF0000">2</font>, <font color="4444FF">-</font><font color="#FF0000">1</font>, <font color="4444FF">+</font><font color="#FF0000">1</font>,  <font color="#FF0000">0</font> <font color="4444FF"><strong>}</strong></font><font color="4444FF">;</font>  <font color="#444444">/* z-edge [3]-[7] */</font>
<a name="line463"> 463</a> 
<a name="line464"> 464</a>          <font color="#2040a0">HYPRE_SStructGridSetFEMOrdering</font><font color="4444FF">(</font><font color="#2040a0">edge_grid</font>, <font color="#2040a0">part</font>, <font color="#2040a0">ordering</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line465"> 465</a>       <font color="4444FF"><strong>}</strong></font>
<a name="line466"> 466</a> 
<a name="line467"> 467</a>       <font color="#444444">/* Set up the Graph - this determines the non-zero structure of the
<a name="line468"> 468</a>          matrix. */</font>
<a name="line469"> 469</a>       <font color="4444FF"><strong>{</strong></font>
<a name="line470"> 470</a>          <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">part</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font>
<a name="line471"> 471</a> 
<a name="line472"> 472</a>          <font color="#444444">/* Create the graph object */</font>
<a name="line473"> 473</a>          <font color="#2040a0">HYPRE_SStructGraphCreate</font><font color="4444FF">(</font><font color="#2040a0">MPI_COMM_WORLD</font>, <font color="#2040a0">edge_grid</font>, <font color="4444FF">&amp;</font><font color="#2040a0">A_graph</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line474"> 474</a> 
<a name="line475"> 475</a>          <font color="#444444">/* See MatrixSetObjectType below */</font>
<a name="line476"> 476</a>          <font color="#2040a0">HYPRE_SStructGraphSetObjectType</font><font color="4444FF">(</font><font color="#2040a0">A_graph</font>, <font color="#2040a0">HYPRE_PARCSR</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line477"> 477</a> 
<a name="line478"> 478</a>          <font color="#444444">/* Indicate that this problem uses finite element stiffness matrices and
<a name="line479"> 479</a>             load vectors, instead of stencils. */</font>
<a name="line480"> 480</a>          <font color="#2040a0">HYPRE_SStructGraphSetFEM</font><font color="4444FF">(</font><font color="#2040a0">A_graph</font>, <font color="#2040a0">part</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line481"> 481</a> 
<a name="line482"> 482</a>          <font color="#444444">/* The edge finite element matrix is full, so there is no need to call the
<a name="line483"> 483</a>             HYPRE_SStructGraphSetFEMSparsity() function. */</font>
<a name="line484"> 484</a> 
<a name="line485"> 485</a>          <font color="#444444">/* Assemble the graph */</font>
<a name="line486"> 486</a>          <font color="#2040a0">HYPRE_SStructGraphAssemble</font><font color="4444FF">(</font><font color="#2040a0">A_graph</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line487"> 487</a>       <font color="4444FF"><strong>}</strong></font>
<a name="line488"> 488</a> 
<a name="line489"> 489</a>       <font color="#444444">/* Set up the SStruct Matrix and right-hand side vector */</font>
<a name="line490"> 490</a>       <font color="4444FF"><strong>{</strong></font>
<a name="line491"> 491</a>          <font color="#444444">/* Create the matrix object */</font>
<a name="line492"> 492</a>          <font color="#2040a0">HYPRE_SStructMatrixCreate</font><font color="4444FF">(</font><font color="#2040a0">MPI_COMM_WORLD</font>, <font color="#2040a0">A_graph</font>, <font color="4444FF">&amp;</font><font color="#2040a0">A</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line493"> 493</a>          <font color="#444444">/* Use a ParCSR storage */</font>
<a name="line494"> 494</a>          <font color="#2040a0">HYPRE_SStructMatrixSetObjectType</font><font color="4444FF">(</font><font color="#2040a0">A</font>, <font color="#2040a0">HYPRE_PARCSR</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line495"> 495</a>          <font color="#444444">/* Indicate that the matrix coefficients are ready to be set */</font>
<a name="line496"> 496</a>          <font color="#2040a0">HYPRE_SStructMatrixInitialize</font><font color="4444FF">(</font><font color="#2040a0">A</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line497"> 497</a> 
<a name="line498"> 498</a>          <font color="#444444">/* Create an empty vector object */</font>
<a name="line499"> 499</a>          <font color="#2040a0">HYPRE_SStructVectorCreate</font><font color="4444FF">(</font><font color="#2040a0">MPI_COMM_WORLD</font>, <font color="#2040a0">edge_grid</font>, <font color="4444FF">&amp;</font><font color="#2040a0">b</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line500"> 500</a>          <font color="#444444">/* Use a ParCSR storage */</font>
<a name="line501"> 501</a>          <font color="#2040a0">HYPRE_SStructVectorSetObjectType</font><font color="4444FF">(</font><font color="#2040a0">b</font>, <font color="#2040a0">HYPRE_PARCSR</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line502"> 502</a>          <font color="#444444">/* Indicate that the vector coefficients are ready to be set */</font>
<a name="line503"> 503</a>          <font color="#2040a0">HYPRE_SStructVectorInitialize</font><font color="4444FF">(</font><font color="#2040a0">b</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line504"> 504</a>       <font color="4444FF"><strong>}</strong></font>
<a name="line505"> 505</a> 
<a name="line506"> 506</a>       <font color="#444444">/* Set the matrix and vector entries by finite element assembly */</font>
<a name="line507"> 507</a>       <font color="4444FF"><strong>{</strong></font>
<a name="line508"> 508</a>          <font color="#444444">/* local stiffness matrix and load vector */</font>
<a name="line509"> 509</a>          <strong>double</strong> <font color="#2040a0">S</font><font color="4444FF">[</font><font color="#FF0000">12</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">12</font><font color="4444FF">]</font>, <font color="#2040a0">F</font><font color="4444FF">[</font><font color="#FF0000">12</font><font color="4444FF">]</font><font color="4444FF">;</font>
<a name="line510"> 510</a> 
<a name="line511"> 511</a>          <strong>int</strong> <font color="#2040a0">i</font>, <font color="#2040a0">j</font>, <font color="#2040a0">k</font><font color="4444FF">;</font>
<a name="line512"> 512</a>          <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">index</font><font color="4444FF">[</font><font color="#FF0000">3</font><font color="4444FF">]</font><font color="4444FF">;</font>
<a name="line513"> 513</a> 
<a name="line514"> 514</a>          <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">i</font> <font color="4444FF">=</font> <font color="#FF0000">1</font><font color="4444FF">;</font> <font color="#2040a0">i</font> <font color="4444FF">&lt;</font><font color="4444FF">=</font> <font color="#2040a0">n</font><font color="4444FF">;</font> <font color="#2040a0">i</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line515"> 515</a>             <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">j</font> <font color="4444FF">=</font> <font color="#FF0000">1</font><font color="4444FF">;</font> <font color="#2040a0">j</font> <font color="4444FF">&lt;</font><font color="4444FF">=</font> <font color="#2040a0">n</font><font color="4444FF">;</font> <font color="#2040a0">j</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line516"> 516</a>                <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">k</font> <font color="4444FF">=</font> <font color="#FF0000">1</font><font color="4444FF">;</font> <font color="#2040a0">k</font> <font color="4444FF">&lt;</font><font color="4444FF">=</font> <font color="#2040a0">n</font><font color="4444FF">;</font> <font color="#2040a0">k</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line517"> 517</a>                <font color="4444FF"><strong>{</strong></font>
<a name="line518"> 518</a>                   <font color="#444444">/* Compute the FEM matrix and r.h.s. for cell (i,j,k) with
<a name="line519"> 519</a>                      coefficients evaluated at the cell center. */</font>
<a name="line520"> 520</a>                   <font color="#2040a0">index</font><font color="4444FF">[</font><font color="#FF0000">0</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#2040a0">i</font> <font color="4444FF">+</font> <font color="#2040a0">pi</font><font color="4444FF">*</font><font color="#2040a0">n</font><font color="4444FF">;</font> <font color="#2040a0">index</font><font color="4444FF">[</font><font color="#FF0000">1</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#2040a0">j</font> <font color="4444FF">+</font> <font color="#2040a0">pj</font><font color="4444FF">*</font><font color="#2040a0">n</font><font color="4444FF">;</font> <font color="#2040a0">index</font><font color="4444FF">[</font><font color="#FF0000">2</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#2040a0">k</font> <font color="4444FF">+</font> <font color="#2040a0">pk</font><font color="4444FF">*</font><font color="#2040a0">n</font><font color="4444FF">;</font>
<a name="line521"> 521</a>                   <font color="#2040a0">ComputeFEMND1</font><font color="4444FF">(</font><font color="#2040a0">S</font>,<font color="#2040a0">F</font>,<font color="4444FF">(</font><font color="#2040a0">pi</font><font color="4444FF">*</font><font color="#2040a0">n</font><font color="4444FF">+</font><font color="#2040a0">i</font><font color="4444FF">)</font><font color="4444FF">*</font><font color="#2040a0">h</font><font color="4444FF">-</font><font color="#2040a0">h</font>/<font color="#FF0000">2</font>,<font color="4444FF">(</font><font color="#2040a0">pj</font><font color="4444FF">*</font><font color="#2040a0">n</font><font color="4444FF">+</font><font color="#2040a0">j</font><font color="4444FF">)</font><font color="4444FF">*</font><font color="#2040a0">h</font><font color="4444FF">-</font><font color="#2040a0">h</font>/<font color="#FF0000">2</font>,<font color="4444FF">(</font><font color="#2040a0">pk</font><font color="4444FF">*</font><font color="#2040a0">n</font><font color="4444FF">+</font><font color="#2040a0">k</font><font color="4444FF">)</font><font color="4444FF">*</font><font color="#2040a0">h</font><font color="4444FF">-</font><font color="#2040a0">h</font>/<font color="#FF0000">2</font>,<font color="#2040a0">h</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line522"> 522</a> 
<a name="line523"> 523</a>                   <font color="#444444">/* Eliminate boundary conditions on x = 0 */</font>
<a name="line524"> 524</a>                   <strong>if</strong> <font color="4444FF">(</font><font color="#2040a0">index</font><font color="4444FF">[</font><font color="#FF0000">0</font><font color="4444FF">]</font> <font color="4444FF">=</font><font color="4444FF">=</font> <font color="#FF0000">1</font><font color="4444FF">)</font>
<a name="line525"> 525</a>                   <font color="4444FF"><strong>{</strong></font>
<a name="line526"> 526</a>                      <strong>int</strong> <font color="#2040a0">ii</font>, <font color="#2040a0">jj</font>, <font color="#2040a0">bc_edges</font><font color="4444FF">[</font><font color="#FF0000">4</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF"><strong>{</strong></font> <font color="#FF0000">3</font>, <font color="#FF0000">11</font>, <font color="#FF0000">7</font>, <font color="#FF0000">8</font> <font color="4444FF"><strong>}</strong></font><font color="4444FF">;</font>
<a name="line527"> 527</a>                      <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">ii</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">ii</font> <font color="4444FF">&lt;</font> <font color="#FF0000">4</font><font color="4444FF">;</font> <font color="#2040a0">ii</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line528"> 528</a>                      <font color="4444FF"><strong>{</strong></font>
<a name="line529"> 529</a>                         <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">jj</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">jj</font> <font color="4444FF">&lt;</font> <font color="#FF0000">12</font><font color="4444FF">;</font> <font color="#2040a0">jj</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line530"> 530</a>                            <font color="#2040a0">S</font><font color="4444FF">[</font><font color="#2040a0">bc_edges</font><font color="4444FF">[</font><font color="#2040a0">ii</font><font color="4444FF">]</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#2040a0">jj</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#2040a0">S</font><font color="4444FF">[</font><font color="#2040a0">jj</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#2040a0">bc_edges</font><font color="4444FF">[</font><font color="#2040a0">ii</font><font color="4444FF">]</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#FF0000">0.0</font><font color="4444FF">;</font>
<a name="line531"> 531</a>                         <font color="#2040a0">S</font><font color="4444FF">[</font><font color="#2040a0">bc_edges</font><font color="4444FF">[</font><font color="#2040a0">ii</font><font color="4444FF">]</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#2040a0">bc_edges</font><font color="4444FF">[</font><font color="#2040a0">ii</font><font color="4444FF">]</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#FF0000">1.0</font><font color="4444FF">;</font>
<a name="line532"> 532</a>                         <font color="#2040a0">F</font><font color="4444FF">[</font><font color="#2040a0">bc_edges</font><font color="4444FF">[</font><font color="#2040a0">ii</font><font color="4444FF">]</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#FF0000">0.0</font><font color="4444FF">;</font>
<a name="line533"> 533</a>                      <font color="4444FF"><strong>}</strong></font>
<a name="line534"> 534</a>                   <font color="4444FF"><strong>}</strong></font>
<a name="line535"> 535</a>                   <font color="#444444">/* Eliminate boundary conditions on y = 0 */</font>
<a name="line536"> 536</a>                   <strong>if</strong> <font color="4444FF">(</font><font color="#2040a0">index</font><font color="4444FF">[</font><font color="#FF0000">1</font><font color="4444FF">]</font> <font color="4444FF">=</font><font color="4444FF">=</font> <font color="#FF0000">1</font><font color="4444FF">)</font>
<a name="line537"> 537</a>                   <font color="4444FF"><strong>{</strong></font>
<a name="line538"> 538</a>                      <strong>int</strong> <font color="#2040a0">ii</font>, <font color="#2040a0">jj</font>, <font color="#2040a0">bc_edges</font><font color="4444FF">[</font><font color="#FF0000">4</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF"><strong>{</strong></font> <font color="#FF0000">0</font>, <font color="#FF0000">9</font>, <font color="#FF0000">4</font>, <font color="#FF0000">8</font> <font color="4444FF"><strong>}</strong></font><font color="4444FF">;</font>
<a name="line539"> 539</a>                      <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">ii</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">ii</font> <font color="4444FF">&lt;</font> <font color="#FF0000">4</font><font color="4444FF">;</font> <font color="#2040a0">ii</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line540"> 540</a>                      <font color="4444FF"><strong>{</strong></font>
<a name="line541"> 541</a>                         <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">jj</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">jj</font> <font color="4444FF">&lt;</font> <font color="#FF0000">12</font><font color="4444FF">;</font> <font color="#2040a0">jj</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line542"> 542</a>                            <font color="#2040a0">S</font><font color="4444FF">[</font><font color="#2040a0">bc_edges</font><font color="4444FF">[</font><font color="#2040a0">ii</font><font color="4444FF">]</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#2040a0">jj</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#2040a0">S</font><font color="4444FF">[</font><font color="#2040a0">jj</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#2040a0">bc_edges</font><font color="4444FF">[</font><font color="#2040a0">ii</font><font color="4444FF">]</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#FF0000">0.0</font><font color="4444FF">;</font>
<a name="line543"> 543</a>                         <font color="#2040a0">S</font><font color="4444FF">[</font><font color="#2040a0">bc_edges</font><font color="4444FF">[</font><font color="#2040a0">ii</font><font color="4444FF">]</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#2040a0">bc_edges</font><font color="4444FF">[</font><font color="#2040a0">ii</font><font color="4444FF">]</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#FF0000">1.0</font><font color="4444FF">;</font>
<a name="line544"> 544</a>                         <font color="#2040a0">F</font><font color="4444FF">[</font><font color="#2040a0">bc_edges</font><font color="4444FF">[</font><font color="#2040a0">ii</font><font color="4444FF">]</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#FF0000">0.0</font><font color="4444FF">;</font>
<a name="line545"> 545</a>                      <font color="4444FF"><strong>}</strong></font>
<a name="line546"> 546</a>                   <font color="4444FF"><strong>}</strong></font>
<a name="line547"> 547</a>                   <font color="#444444">/* Eliminate boundary conditions on z = 0 */</font>
<a name="line548"> 548</a>                   <strong>if</strong> <font color="4444FF">(</font><font color="#2040a0">index</font><font color="4444FF">[</font><font color="#FF0000">2</font><font color="4444FF">]</font> <font color="4444FF">=</font><font color="4444FF">=</font> <font color="#FF0000">1</font><font color="4444FF">)</font>
<a name="line549"> 549</a>                   <font color="4444FF"><strong>{</strong></font>
<a name="line550"> 550</a>                      <strong>int</strong> <font color="#2040a0">ii</font>, <font color="#2040a0">jj</font>, <font color="#2040a0">bc_edges</font><font color="4444FF">[</font><font color="#FF0000">4</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF"><strong>{</strong></font> <font color="#FF0000">0</font>, <font color="#FF0000">1</font>, <font color="#FF0000">2</font>, <font color="#FF0000">3</font> <font color="4444FF"><strong>}</strong></font><font color="4444FF">;</font>
<a name="line551"> 551</a>                      <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">ii</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">ii</font> <font color="4444FF">&lt;</font> <font color="#FF0000">4</font><font color="4444FF">;</font> <font color="#2040a0">ii</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line552"> 552</a>                      <font color="4444FF"><strong>{</strong></font>
<a name="line553"> 553</a>                         <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">jj</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">jj</font> <font color="4444FF">&lt;</font> <font color="#FF0000">12</font><font color="4444FF">;</font> <font color="#2040a0">jj</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line554"> 554</a>                            <font color="#2040a0">S</font><font color="4444FF">[</font><font color="#2040a0">bc_edges</font><font color="4444FF">[</font><font color="#2040a0">ii</font><font color="4444FF">]</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#2040a0">jj</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#2040a0">S</font><font color="4444FF">[</font><font color="#2040a0">jj</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#2040a0">bc_edges</font><font color="4444FF">[</font><font color="#2040a0">ii</font><font color="4444FF">]</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#FF0000">0.0</font><font color="4444FF">;</font>
<a name="line555"> 555</a>                         <font color="#2040a0">S</font><font color="4444FF">[</font><font color="#2040a0">bc_edges</font><font color="4444FF">[</font><font color="#2040a0">ii</font><font color="4444FF">]</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#2040a0">bc_edges</font><font color="4444FF">[</font><font color="#2040a0">ii</font><font color="4444FF">]</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#FF0000">1.0</font><font color="4444FF">;</font>
<a name="line556"> 556</a>                         <font color="#2040a0">F</font><font color="4444FF">[</font><font color="#2040a0">bc_edges</font><font color="4444FF">[</font><font color="#2040a0">ii</font><font color="4444FF">]</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#FF0000">0.0</font><font color="4444FF">;</font>
<a name="line557"> 557</a>                      <font color="4444FF"><strong>}</strong></font>
<a name="line558"> 558</a>                   <font color="4444FF"><strong>}</strong></font>
<a name="line559"> 559</a>                   <font color="#444444">/* Eliminate boundary conditions on x = 1 */</font>
<a name="line560"> 560</a>                   <strong>if</strong> <font color="4444FF">(</font><font color="#2040a0">index</font><font color="4444FF">[</font><font color="#FF0000">0</font><font color="4444FF">]</font> <font color="4444FF">=</font><font color="4444FF">=</font> <font color="#2040a0">N</font><font color="4444FF">*</font><font color="#2040a0">n</font><font color="4444FF">)</font>
<a name="line561"> 561</a>                   <font color="4444FF"><strong>{</strong></font>
<a name="line562"> 562</a>                      <strong>int</strong> <font color="#2040a0">ii</font>, <font color="#2040a0">jj</font>, <font color="#2040a0">bc_edges</font><font color="4444FF">[</font><font color="#FF0000">4</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF"><strong>{</strong></font> <font color="#FF0000">1</font>, <font color="#FF0000">10</font>, <font color="#FF0000">5</font>, <font color="#FF0000">9</font> <font color="4444FF"><strong>}</strong></font><font color="4444FF">;</font>
<a name="line563"> 563</a>                      <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">ii</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">ii</font> <font color="4444FF">&lt;</font> <font color="#FF0000">4</font><font color="4444FF">;</font> <font color="#2040a0">ii</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line564"> 564</a>                      <font color="4444FF"><strong>{</strong></font>
<a name="line565"> 565</a>                         <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">jj</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">jj</font> <font color="4444FF">&lt;</font> <font color="#FF0000">12</font><font color="4444FF">;</font> <font color="#2040a0">jj</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line566"> 566</a>                            <font color="#2040a0">S</font><font color="4444FF">[</font><font color="#2040a0">bc_edges</font><font color="4444FF">[</font><font color="#2040a0">ii</font><font color="4444FF">]</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#2040a0">jj</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#2040a0">S</font><font color="4444FF">[</font><font color="#2040a0">jj</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#2040a0">bc_edges</font><font color="4444FF">[</font><font color="#2040a0">ii</font><font color="4444FF">]</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#FF0000">0.0</font><font color="4444FF">;</font>
<a name="line567"> 567</a>                         <font color="#2040a0">S</font><font color="4444FF">[</font><font color="#2040a0">bc_edges</font><font color="4444FF">[</font><font color="#2040a0">ii</font><font color="4444FF">]</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#2040a0">bc_edges</font><font color="4444FF">[</font><font color="#2040a0">ii</font><font color="4444FF">]</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#FF0000">1.0</font><font color="4444FF">;</font>
<a name="line568"> 568</a>                         <font color="#2040a0">F</font><font color="4444FF">[</font><font color="#2040a0">bc_edges</font><font color="4444FF">[</font><font color="#2040a0">ii</font><font color="4444FF">]</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#FF0000">0.0</font><font color="4444FF">;</font>
<a name="line569"> 569</a>                      <font color="4444FF"><strong>}</strong></font>
<a name="line570"> 570</a>                   <font color="4444FF"><strong>}</strong></font>
<a name="line571"> 571</a>                   <font color="#444444">/* Eliminate boundary conditions on y = 1 */</font>
<a name="line572"> 572</a>                   <strong>if</strong> <font color="4444FF">(</font><font color="#2040a0">index</font><font color="4444FF">[</font><font color="#FF0000">1</font><font color="4444FF">]</font> <font color="4444FF">=</font><font color="4444FF">=</font> <font color="#2040a0">N</font><font color="4444FF">*</font><font color="#2040a0">n</font><font color="4444FF">)</font>
<a name="line573"> 573</a>                   <font color="4444FF"><strong>{</strong></font>
<a name="line574"> 574</a>                      <strong>int</strong> <font color="#2040a0">ii</font>, <font color="#2040a0">jj</font>, <font color="#2040a0">bc_edges</font><font color="4444FF">[</font><font color="#FF0000">4</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF"><strong>{</strong></font> <font color="#FF0000">2</font>, <font color="#FF0000">10</font>, <font color="#FF0000">6</font>, <font color="#FF0000">11</font> <font color="4444FF"><strong>}</strong></font><font color="4444FF">;</font>
<a name="line575"> 575</a>                      <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">ii</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">ii</font> <font color="4444FF">&lt;</font> <font color="#FF0000">4</font><font color="4444FF">;</font> <font color="#2040a0">ii</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line576"> 576</a>                      <font color="4444FF"><strong>{</strong></font>
<a name="line577"> 577</a>                         <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">jj</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">jj</font> <font color="4444FF">&lt;</font> <font color="#FF0000">12</font><font color="4444FF">;</font> <font color="#2040a0">jj</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line578"> 578</a>                            <font color="#2040a0">S</font><font color="4444FF">[</font><font color="#2040a0">bc_edges</font><font color="4444FF">[</font><font color="#2040a0">ii</font><font color="4444FF">]</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#2040a0">jj</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#2040a0">S</font><font color="4444FF">[</font><font color="#2040a0">jj</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#2040a0">bc_edges</font><font color="4444FF">[</font><font color="#2040a0">ii</font><font color="4444FF">]</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#FF0000">0.0</font><font color="4444FF">;</font>
<a name="line579"> 579</a>                         <font color="#2040a0">S</font><font color="4444FF">[</font><font color="#2040a0">bc_edges</font><font color="4444FF">[</font><font color="#2040a0">ii</font><font color="4444FF">]</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#2040a0">bc_edges</font><font color="4444FF">[</font><font color="#2040a0">ii</font><font color="4444FF">]</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#FF0000">1.0</font><font color="4444FF">;</font>
<a name="line580"> 580</a>                         <font color="#2040a0">F</font><font color="4444FF">[</font><font color="#2040a0">bc_edges</font><font color="4444FF">[</font><font color="#2040a0">ii</font><font color="4444FF">]</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#FF0000">0.0</font><font color="4444FF">;</font>
<a name="line581"> 581</a>                      <font color="4444FF"><strong>}</strong></font>
<a name="line582"> 582</a>                   <font color="4444FF"><strong>}</strong></font>
<a name="line583"> 583</a>                   <font color="#444444">/* Eliminate boundary conditions on z = 1 */</font>
<a name="line584"> 584</a>                   <strong>if</strong> <font color="4444FF">(</font><font color="#2040a0">index</font><font color="4444FF">[</font><font color="#FF0000">2</font><font color="4444FF">]</font> <font color="4444FF">=</font><font color="4444FF">=</font> <font color="#2040a0">N</font><font color="4444FF">*</font><font color="#2040a0">n</font><font color="4444FF">)</font>
<a name="line585"> 585</a>                   <font color="4444FF"><strong>{</strong></font>
<a name="line586"> 586</a>                      <strong>int</strong> <font color="#2040a0">ii</font>, <font color="#2040a0">jj</font>, <font color="#2040a0">bc_edges</font><font color="4444FF">[</font><font color="#FF0000">4</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF"><strong>{</strong></font> <font color="#FF0000">4</font>, <font color="#FF0000">5</font>, <font color="#FF0000">6</font>, <font color="#FF0000">7</font> <font color="4444FF"><strong>}</strong></font><font color="4444FF">;</font>
<a name="line587"> 587</a>                      <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">ii</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">ii</font> <font color="4444FF">&lt;</font> <font color="#FF0000">4</font><font color="4444FF">;</font> <font color="#2040a0">ii</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line588"> 588</a>                      <font color="4444FF"><strong>{</strong></font>
<a name="line589"> 589</a>                         <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">jj</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">jj</font> <font color="4444FF">&lt;</font> <font color="#FF0000">12</font><font color="4444FF">;</font> <font color="#2040a0">jj</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line590"> 590</a>                            <font color="#2040a0">S</font><font color="4444FF">[</font><font color="#2040a0">bc_edges</font><font color="4444FF">[</font><font color="#2040a0">ii</font><font color="4444FF">]</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#2040a0">jj</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#2040a0">S</font><font color="4444FF">[</font><font color="#2040a0">jj</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#2040a0">bc_edges</font><font color="4444FF">[</font><font color="#2040a0">ii</font><font color="4444FF">]</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#FF0000">0.0</font><font color="4444FF">;</font>
<a name="line591"> 591</a>                         <font color="#2040a0">S</font><font color="4444FF">[</font><font color="#2040a0">bc_edges</font><font color="4444FF">[</font><font color="#2040a0">ii</font><font color="4444FF">]</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#2040a0">bc_edges</font><font color="4444FF">[</font><font color="#2040a0">ii</font><font color="4444FF">]</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#FF0000">1.0</font><font color="4444FF">;</font>
<a name="line592"> 592</a>                         <font color="#2040a0">F</font><font color="4444FF">[</font><font color="#2040a0">bc_edges</font><font color="4444FF">[</font><font color="#2040a0">ii</font><font color="4444FF">]</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#FF0000">0.0</font><font color="4444FF">;</font>
<a name="line593"> 593</a>                      <font color="4444FF"><strong>}</strong></font>
<a name="line594"> 594</a>                   <font color="4444FF"><strong>}</strong></font>
<a name="line595"> 595</a> 
<a name="line596"> 596</a>                   <font color="#444444">/* Assemble the matrix */</font>
<a name="line597"> 597</a>                   <font color="#2040a0">HYPRE_SStructMatrixAddFEMValues</font><font color="4444FF">(</font><font color="#2040a0">A</font>, <font color="#2040a0">part</font>, <font color="#2040a0">index</font>, <font color="4444FF">&amp;</font><font color="#2040a0">S</font><font color="4444FF">[</font><font color="#FF0000">0</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">0</font><font color="4444FF">]</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line598"> 598</a> 
<a name="line599"> 599</a>                   <font color="#444444">/* Assemble the vector */</font>
<a name="line600"> 600</a>                   <font color="#2040a0">HYPRE_SStructVectorAddFEMValues</font><font color="4444FF">(</font><font color="#2040a0">b</font>, <font color="#2040a0">part</font>, <font color="#2040a0">index</font>, <font color="#2040a0">F</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line601"> 601</a>                <font color="4444FF"><strong>}</strong></font>
<a name="line602"> 602</a>       <font color="4444FF"><strong>}</strong></font>
<a name="line603"> 603</a> 
<a name="line604"> 604</a>       <font color="#444444">/* Collective calls finalizing the matrix and vector assembly */</font>
<a name="line605"> 605</a>       <font color="#2040a0">HYPRE_SStructMatrixAssemble</font><font color="4444FF">(</font><font color="#2040a0">A</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line606"> 606</a>       <font color="#2040a0">HYPRE_SStructVectorAssemble</font><font color="4444FF">(</font><font color="#2040a0">b</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line607"> 607</a>    <font color="4444FF"><strong>}</strong></font>
<a name="line608"> 608</a> 
<a name="line609"> 609</a>    <font color="#444444">/* 3. Create the discrete gradient matrix G, which is needed in AMS. */</font>
<a name="line610"> 610</a>    <font color="4444FF"><strong>{</strong></font>
<a name="line611"> 611</a>       <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">part</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font>
<a name="line612"> 612</a>       <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">stencil_size</font> <font color="4444FF">=</font> <font color="#FF0000">2</font><font color="4444FF">;</font>
<a name="line613"> 613</a> 
<a name="line614"> 614</a>       <font color="#444444">/* Define the discretization stencil relating the edges and nodes of the
<a name="line615"> 615</a>          grid. */</font>
<a name="line616"> 616</a>       <font color="4444FF"><strong>{</strong></font>
<a name="line617"> 617</a>          <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">ndim</font> <font color="4444FF">=</font> <font color="#FF0000">3</font><font color="4444FF">;</font>
<a name="line618"> 618</a>          <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">entry</font><font color="4444FF">;</font>
<a name="line619"> 619</a>          <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">var</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#444444">/* the node variable */</font>
<a name="line620"> 620</a> 
<a name="line621"> 621</a>          <font color="#444444">/* The discrete gradient stencils connect edge to node variables. */</font>
<a name="line622"> 622</a>          <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">Gx_offsets</font><font color="4444FF">[</font><font color="#FF0000">2</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">3</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF"><strong>{</strong></font><font color="4444FF"><strong>{</strong></font><font color="4444FF">-</font><font color="#FF0000">1</font>,<font color="#FF0000">0</font>,<font color="#FF0000">0</font><font color="4444FF"><strong>}</strong></font>,<font color="4444FF"><strong>{</strong></font><font color="#FF0000">0</font>,<font color="#FF0000">0</font>,<font color="#FF0000">0</font><font color="4444FF"><strong>}</strong></font><font color="4444FF"><strong>}</strong></font><font color="4444FF">;</font>  <font color="#444444">/* x-edge [7]-[6] */</font>
<a name="line623"> 623</a>          <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">Gy_offsets</font><font color="4444FF">[</font><font color="#FF0000">2</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">3</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF"><strong>{</strong></font><font color="4444FF"><strong>{</strong></font><font color="#FF0000">0</font>,<font color="4444FF">-</font><font color="#FF0000">1</font>,<font color="#FF0000">0</font><font color="4444FF"><strong>}</strong></font>,<font color="4444FF"><strong>{</strong></font><font color="#FF0000">0</font>,<font color="#FF0000">0</font>,<font color="#FF0000">0</font><font color="4444FF"><strong>}</strong></font><font color="4444FF"><strong>}</strong></font><font color="4444FF">;</font>  <font color="#444444">/* y-edge [5]-[6] */</font>
<a name="line624"> 624</a>          <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">Gz_offsets</font><font color="4444FF">[</font><font color="#FF0000">2</font><font color="4444FF">]</font><font color="4444FF">[</font><font color="#FF0000">3</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF"><strong>{</strong></font><font color="4444FF"><strong>{</strong></font><font color="#FF0000">0</font>,<font color="#FF0000">0</font>,<font color="4444FF">-</font><font color="#FF0000">1</font><font color="4444FF"><strong>}</strong></font>,<font color="4444FF"><strong>{</strong></font><font color="#FF0000">0</font>,<font color="#FF0000">0</font>,<font color="#FF0000">0</font><font color="4444FF"><strong>}</strong></font><font color="4444FF"><strong>}</strong></font><font color="4444FF">;</font>  <font color="#444444">/* z-edge [2]-[6] */</font>
<a name="line625"> 625</a> 
<a name="line626"> 626</a>          <font color="#2040a0">HYPRE_SStructStencilCreate</font><font color="4444FF">(</font><font color="#2040a0">ndim</font>, <font color="#2040a0">stencil_size</font>, <font color="4444FF">&amp;</font><font color="#2040a0">G_stencil</font><font color="4444FF">[</font><font color="#FF0000">0</font><font color="4444FF">]</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line627"> 627</a>          <font color="#2040a0">HYPRE_SStructStencilCreate</font><font color="4444FF">(</font><font color="#2040a0">ndim</font>, <font color="#2040a0">stencil_size</font>, <font color="4444FF">&amp;</font><font color="#2040a0">G_stencil</font><font color="4444FF">[</font><font color="#FF0000">1</font><font color="4444FF">]</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line628"> 628</a>          <font color="#2040a0">HYPRE_SStructStencilCreate</font><font color="4444FF">(</font><font color="#2040a0">ndim</font>, <font color="#2040a0">stencil_size</font>, <font color="4444FF">&amp;</font><font color="#2040a0">G_stencil</font><font color="4444FF">[</font><font color="#FF0000">2</font><font color="4444FF">]</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line629"> 629</a> 
<a name="line630"> 630</a>          <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">entry</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">entry</font> <font color="4444FF">&lt;</font> <font color="#2040a0">stencil_size</font><font color="4444FF">;</font> <font color="#2040a0">entry</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line631"> 631</a>          <font color="4444FF"><strong>{</strong></font>
<a name="line632"> 632</a>             <font color="#2040a0">HYPRE_SStructStencilSetEntry</font><font color="4444FF">(</font><font color="#2040a0">G_stencil</font><font color="4444FF">[</font><font color="#FF0000">0</font><font color="4444FF">]</font>, <font color="#2040a0">entry</font>, <font color="#2040a0">Gx_offsets</font><font color="4444FF">[</font><font color="#2040a0">entry</font><font color="4444FF">]</font>, <font color="#2040a0">var</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line633"> 633</a>             <font color="#2040a0">HYPRE_SStructStencilSetEntry</font><font color="4444FF">(</font><font color="#2040a0">G_stencil</font><font color="4444FF">[</font><font color="#FF0000">1</font><font color="4444FF">]</font>, <font color="#2040a0">entry</font>, <font color="#2040a0">Gy_offsets</font><font color="4444FF">[</font><font color="#2040a0">entry</font><font color="4444FF">]</font>, <font color="#2040a0">var</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line634"> 634</a>             <font color="#2040a0">HYPRE_SStructStencilSetEntry</font><font color="4444FF">(</font><font color="#2040a0">G_stencil</font><font color="4444FF">[</font><font color="#FF0000">2</font><font color="4444FF">]</font>, <font color="#2040a0">entry</font>, <font color="#2040a0">Gz_offsets</font><font color="4444FF">[</font><font color="#2040a0">entry</font><font color="4444FF">]</font>, <font color="#2040a0">var</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line635"> 635</a>          <font color="4444FF"><strong>}</strong></font>
<a name="line636"> 636</a>       <font color="4444FF"><strong>}</strong></font>
<a name="line637"> 637</a> 
<a name="line638"> 638</a>       <font color="#444444">/* Set up the Graph - this determines the non-zero structure of the
<a name="line639"> 639</a>          matrix. */</font>
<a name="line640"> 640</a>       <font color="4444FF"><strong>{</strong></font>
<a name="line641"> 641</a>          <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">nvars</font> <font color="4444FF">=</font> <font color="#FF0000">3</font><font color="4444FF">;</font>
<a name="line642"> 642</a>          <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">var</font><font color="4444FF">;</font> <font color="#444444">/* the edge variables */</font>
<a name="line643"> 643</a> 
<a name="line644"> 644</a>          <font color="#444444">/* Create the discrete gradient graph object */</font>
<a name="line645"> 645</a>          <font color="#2040a0">HYPRE_SStructGraphCreate</font><font color="4444FF">(</font><font color="#2040a0">MPI_COMM_WORLD</font>, <font color="#2040a0">edge_grid</font>, <font color="4444FF">&amp;</font><font color="#2040a0">G_graph</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line646"> 646</a> 
<a name="line647"> 647</a>          <font color="#444444">/* See MatrixSetObjectType below */</font>
<a name="line648"> 648</a>          <font color="#2040a0">HYPRE_SStructGraphSetObjectType</font><font color="4444FF">(</font><font color="#2040a0">G_graph</font>, <font color="#2040a0">HYPRE_PARCSR</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line649"> 649</a> 
<a name="line650"> 650</a>          <font color="#444444">/* Since the discrete gradient relates edge and nodal variables (it is a
<a name="line651"> 651</a>             rectangular matrix), we have to specify the domain (column) grid. */</font>
<a name="line652"> 652</a>          <font color="#2040a0">HYPRE_SStructGraphSetDomainGrid</font><font color="4444FF">(</font><font color="#2040a0">G_graph</font>, <font color="#2040a0">node_grid</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line653"> 653</a> 
<a name="line654"> 654</a>          <font color="#444444">/* Tell the graph which stencil to use for each edge variable on each
<a name="line655"> 655</a>             part (we only have one part). */</font>
<a name="line656"> 656</a>          <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">var</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">var</font> <font color="4444FF">&lt;</font> <font color="#2040a0">nvars</font><font color="4444FF">;</font> <font color="#2040a0">var</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line657"> 657</a>             <font color="#2040a0">HYPRE_SStructGraphSetStencil</font><font color="4444FF">(</font><font color="#2040a0">G_graph</font>, <font color="#2040a0">part</font>, <font color="#2040a0">var</font>, <font color="#2040a0">G_stencil</font><font color="4444FF">[</font><font color="#2040a0">var</font><font color="4444FF">]</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line658"> 658</a> 
<a name="line659"> 659</a>          <font color="#444444">/* Assemble the graph */</font>
<a name="line660"> 660</a>          <font color="#2040a0">HYPRE_SStructGraphAssemble</font><font color="4444FF">(</font><font color="#2040a0">G_graph</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line661"> 661</a>       <font color="4444FF"><strong>}</strong></font>
<a name="line662"> 662</a> 
<a name="line663"> 663</a>       <font color="#444444">/* Set up the SStruct Matrix */</font>
<a name="line664"> 664</a>       <font color="4444FF"><strong>{</strong></font>
<a name="line665"> 665</a>          <font color="#444444">/* Create the matrix object */</font>
<a name="line666"> 666</a>          <font color="#2040a0">HYPRE_SStructMatrixCreate</font><font color="4444FF">(</font><font color="#2040a0">MPI_COMM_WORLD</font>, <font color="#2040a0">G_graph</font>, <font color="4444FF">&amp;</font><font color="#2040a0">G</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line667"> 667</a>          <font color="#444444">/* Use a ParCSR storage */</font>
<a name="line668"> 668</a>          <font color="#2040a0">HYPRE_SStructMatrixSetObjectType</font><font color="4444FF">(</font><font color="#2040a0">G</font>, <font color="#2040a0">HYPRE_PARCSR</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line669"> 669</a>          <font color="#444444">/* Indicate that the matrix coefficients are ready to be set */</font>
<a name="line670"> 670</a>          <font color="#2040a0">HYPRE_SStructMatrixInitialize</font><font color="4444FF">(</font><font color="#2040a0">G</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line671"> 671</a>       <font color="4444FF"><strong>}</strong></font>
<a name="line672"> 672</a> 
<a name="line673"> 673</a>       <font color="#444444">/* Set the discrete gradient values, assuming a &quot;natural&quot; orientation of
<a name="line674"> 674</a>          the edges (i.e. one in agreement with the coordinate directions). */</font>
<a name="line675"> 675</a>       <font color="4444FF"><strong>{</strong></font>
<a name="line676"> 676</a>          <strong>int</strong> <font color="#2040a0">i</font><font color="4444FF">;</font>
<a name="line677"> 677</a>          <strong>int</strong> <font color="#2040a0">nedges</font> <font color="4444FF">=</font> <font color="#2040a0">n</font><font color="4444FF">*</font><font color="4444FF">(</font><font color="#2040a0">n</font><font color="4444FF">+</font><font color="#FF0000">1</font><font color="4444FF">)</font><font color="4444FF">*</font><font color="4444FF">(</font><font color="#2040a0">n</font><font color="4444FF">+</font><font color="#FF0000">1</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line678"> 678</a>          <strong>double</strong> <font color="4444FF">*</font><font color="#2040a0">values</font><font color="4444FF">;</font>
<a name="line679"> 679</a>          <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">stencil_indices</font><font color="4444FF">[</font><font color="#FF0000">2</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF"><strong>{</strong></font><font color="#FF0000">0</font>,<font color="#FF0000">1</font><font color="4444FF"><strong>}</strong></font><font color="4444FF">;</font> <font color="#444444">/* the nodes of each edge */</font>
<a name="line680"> 680</a> 
<a name="line681"> 681</a>          <font color="#2040a0">values</font> <font color="4444FF">=</font> <font color="#2040a0">calloc</font><font color="4444FF">(</font><font color="#FF0000">2</font><font color="4444FF">*</font><font color="#2040a0">nedges</font>, <strong>sizeof</strong><font color="4444FF">(</font><strong>double</strong><font color="4444FF">)</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line682"> 682</a> 
<a name="line683"> 683</a>          <font color="#444444">/* The edge orientation is fixed: from first to second node */</font>
<a name="line684"> 684</a>          <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">i</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">i</font> <font color="4444FF">&lt;</font> <font color="#2040a0">nedges</font><font color="4444FF">;</font> <font color="#2040a0">i</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line685"> 685</a>          <font color="4444FF"><strong>{</strong></font>
<a name="line686"> 686</a>             <font color="#2040a0">values</font><font color="4444FF">[</font><font color="#FF0000">2</font><font color="4444FF">*</font><font color="#2040a0">i</font><font color="4444FF">]</font>   <font color="4444FF">=</font> <font color="4444FF">-</font><font color="#FF0000">1.0</font><font color="4444FF">;</font>
<a name="line687"> 687</a>             <font color="#2040a0">values</font><font color="4444FF">[</font><font color="#FF0000">2</font><font color="4444FF">*</font><font color="#2040a0">i</font><font color="4444FF">+</font><font color="#FF0000">1</font><font color="4444FF">]</font> <font color="4444FF">=</font>  <font color="#FF0000">1.0</font><font color="4444FF">;</font>
<a name="line688"> 688</a>          <font color="4444FF"><strong>}</strong></font>
<a name="line689"> 689</a> 
<a name="line690"> 690</a>          <font color="#444444">/* Set the values in the discrete gradient x-edges */</font>
<a name="line691"> 691</a>          <font color="4444FF"><strong>{</strong></font>
<a name="line692"> 692</a>             <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">var</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font>
<a name="line693"> 693</a>             <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">ilower</font><font color="4444FF">[</font><font color="#FF0000">3</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF"><strong>{</strong></font><font color="#FF0000">1</font> <font color="4444FF">+</font> <font color="#2040a0">pi</font><font color="4444FF">*</font><font color="#2040a0">n</font>, <font color="#FF0000">0</font> <font color="4444FF">+</font> <font color="#2040a0">pj</font><font color="4444FF">*</font><font color="#2040a0">n</font>, <font color="#FF0000">0</font> <font color="4444FF">+</font> <font color="#2040a0">pk</font><font color="4444FF">*</font><font color="#2040a0">n</font><font color="4444FF"><strong>}</strong></font><font color="4444FF">;</font>
<a name="line694"> 694</a>             <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">iupper</font><font color="4444FF">[</font><font color="#FF0000">3</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF"><strong>{</strong></font><font color="#2040a0">n</font> <font color="4444FF">+</font> <font color="#2040a0">pi</font><font color="4444FF">*</font><font color="#2040a0">n</font>, <font color="#2040a0">n</font> <font color="4444FF">+</font> <font color="#2040a0">pj</font><font color="4444FF">*</font><font color="#2040a0">n</font>, <font color="#2040a0">n</font> <font color="4444FF">+</font> <font color="#2040a0">pk</font><font color="4444FF">*</font><font color="#2040a0">n</font><font color="4444FF"><strong>}</strong></font><font color="4444FF">;</font>
<a name="line695"> 695</a>             <font color="#2040a0">HYPRE_SStructMatrixSetBoxValues</font><font color="4444FF">(</font><font color="#2040a0">G</font>, <font color="#2040a0">part</font>, <font color="#2040a0">ilower</font>, <font color="#2040a0">iupper</font>, <font color="#2040a0">var</font>,
<a name="line696"> 696</a>                                             <font color="#2040a0">stencil_size</font>, <font color="#2040a0">stencil_indices</font>,
<a name="line697"> 697</a>                                             <font color="#2040a0">values</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line698"> 698</a>          <font color="4444FF"><strong>}</strong></font>
<a name="line699"> 699</a>          <font color="#444444">/* Set the values in the discrete gradient y-edges */</font>
<a name="line700"> 700</a>          <font color="4444FF"><strong>{</strong></font>
<a name="line701"> 701</a>             <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">var</font> <font color="4444FF">=</font> <font color="#FF0000">1</font><font color="4444FF">;</font>
<a name="line702"> 702</a>             <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">ilower</font><font color="4444FF">[</font><font color="#FF0000">3</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF"><strong>{</strong></font><font color="#FF0000">0</font> <font color="4444FF">+</font> <font color="#2040a0">pi</font><font color="4444FF">*</font><font color="#2040a0">n</font>, <font color="#FF0000">1</font> <font color="4444FF">+</font> <font color="#2040a0">pj</font><font color="4444FF">*</font><font color="#2040a0">n</font>, <font color="#FF0000">0</font> <font color="4444FF">+</font> <font color="#2040a0">pk</font><font color="4444FF">*</font><font color="#2040a0">n</font><font color="4444FF"><strong>}</strong></font><font color="4444FF">;</font>
<a name="line703"> 703</a>             <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">iupper</font><font color="4444FF">[</font><font color="#FF0000">3</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF"><strong>{</strong></font><font color="#2040a0">n</font> <font color="4444FF">+</font> <font color="#2040a0">pi</font><font color="4444FF">*</font><font color="#2040a0">n</font>, <font color="#2040a0">n</font> <font color="4444FF">+</font> <font color="#2040a0">pj</font><font color="4444FF">*</font><font color="#2040a0">n</font>, <font color="#2040a0">n</font> <font color="4444FF">+</font> <font color="#2040a0">pk</font><font color="4444FF">*</font><font color="#2040a0">n</font><font color="4444FF"><strong>}</strong></font><font color="4444FF">;</font>
<a name="line704"> 704</a>             <font color="#2040a0">HYPRE_SStructMatrixSetBoxValues</font><font color="4444FF">(</font><font color="#2040a0">G</font>, <font color="#2040a0">part</font>, <font color="#2040a0">ilower</font>, <font color="#2040a0">iupper</font>, <font color="#2040a0">var</font>,
<a name="line705"> 705</a>                                             <font color="#2040a0">stencil_size</font>, <font color="#2040a0">stencil_indices</font>,
<a name="line706"> 706</a>                                             <font color="#2040a0">values</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line707"> 707</a>          <font color="4444FF"><strong>}</strong></font>
<a name="line708"> 708</a>          <font color="#444444">/* Set the values in the discrete gradient z-edges */</font>
<a name="line709"> 709</a>          <font color="4444FF"><strong>{</strong></font>
<a name="line710"> 710</a>             <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">var</font> <font color="4444FF">=</font> <font color="#FF0000">2</font><font color="4444FF">;</font>
<a name="line711"> 711</a>             <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">ilower</font><font color="4444FF">[</font><font color="#FF0000">3</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF"><strong>{</strong></font><font color="#FF0000">0</font> <font color="4444FF">+</font> <font color="#2040a0">pi</font><font color="4444FF">*</font><font color="#2040a0">n</font>, <font color="#FF0000">0</font> <font color="4444FF">+</font> <font color="#2040a0">pj</font><font color="4444FF">*</font><font color="#2040a0">n</font>, <font color="#FF0000">1</font> <font color="4444FF">+</font> <font color="#2040a0">pk</font><font color="4444FF">*</font><font color="#2040a0">n</font><font color="4444FF"><strong>}</strong></font><font color="4444FF">;</font>
<a name="line712"> 712</a>             <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">iupper</font><font color="4444FF">[</font><font color="#FF0000">3</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF"><strong>{</strong></font><font color="#2040a0">n</font> <font color="4444FF">+</font> <font color="#2040a0">pi</font><font color="4444FF">*</font><font color="#2040a0">n</font>, <font color="#2040a0">n</font> <font color="4444FF">+</font> <font color="#2040a0">pj</font><font color="4444FF">*</font><font color="#2040a0">n</font>, <font color="#2040a0">n</font> <font color="4444FF">+</font> <font color="#2040a0">pk</font><font color="4444FF">*</font><font color="#2040a0">n</font><font color="4444FF"><strong>}</strong></font><font color="4444FF">;</font>
<a name="line713"> 713</a>             <font color="#2040a0">HYPRE_SStructMatrixSetBoxValues</font><font color="4444FF">(</font><font color="#2040a0">G</font>, <font color="#2040a0">part</font>, <font color="#2040a0">ilower</font>, <font color="#2040a0">iupper</font>, <font color="#2040a0">var</font>,
<a name="line714"> 714</a>                                             <font color="#2040a0">stencil_size</font>, <font color="#2040a0">stencil_indices</font>,
<a name="line715"> 715</a>                                             <font color="#2040a0">values</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line716"> 716</a>          <font color="4444FF"><strong>}</strong></font>
<a name="line717"> 717</a> 
<a name="line718"> 718</a>          <font color="#2040a0">free</font><font color="4444FF">(</font><font color="#2040a0">values</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line719"> 719</a>       <font color="4444FF"><strong>}</strong></font>
<a name="line720"> 720</a> 
<a name="line721"> 721</a>       <font color="#444444">/* Finalize the matrix assembly */</font>
<a name="line722"> 722</a>       <font color="#2040a0">HYPRE_SStructMatrixAssemble</font><font color="4444FF">(</font><font color="#2040a0">G</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line723"> 723</a>    <font color="4444FF"><strong>}</strong></font>
<a name="line724"> 724</a> 
<a name="line725"> 725</a>    <font color="#444444">/* 4. Create the vectors of nodal coordinates xcoord, ycoord and zcoord,
<a name="line726"> 726</a>          which are needed in AMS. */</font>
<a name="line727"> 727</a>    <font color="4444FF"><strong>{</strong></font>
<a name="line728"> 728</a>       <strong>int</strong> <font color="#2040a0">i</font>, <font color="#2040a0">j</font>, <font color="#2040a0">k</font><font color="4444FF">;</font>
<a name="line729"> 729</a>       <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">part</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font>
<a name="line730"> 730</a>       <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">var</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#444444">/* the node variable */</font>
<a name="line731"> 731</a>       <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">index</font><font color="4444FF">[</font><font color="#FF0000">3</font><font color="4444FF">]</font><font color="4444FF">;</font>
<a name="line732"> 732</a>       <strong>double</strong> <font color="#2040a0">xval</font>, <font color="#2040a0">yval</font>, <font color="#2040a0">zval</font><font color="4444FF">;</font>
<a name="line733"> 733</a> 
<a name="line734"> 734</a>       <font color="#444444">/* Create empty vector objects */</font>
<a name="line735"> 735</a>       <font color="#2040a0">HYPRE_SStructVectorCreate</font><font color="4444FF">(</font><font color="#2040a0">MPI_COMM_WORLD</font>, <font color="#2040a0">node_grid</font>, <font color="4444FF">&amp;</font><font color="#2040a0">xcoord</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line736"> 736</a>       <font color="#2040a0">HYPRE_SStructVectorCreate</font><font color="4444FF">(</font><font color="#2040a0">MPI_COMM_WORLD</font>, <font color="#2040a0">node_grid</font>, <font color="4444FF">&amp;</font><font color="#2040a0">ycoord</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line737"> 737</a>       <font color="#2040a0">HYPRE_SStructVectorCreate</font><font color="4444FF">(</font><font color="#2040a0">MPI_COMM_WORLD</font>, <font color="#2040a0">node_grid</font>, <font color="4444FF">&amp;</font><font color="#2040a0">zcoord</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line738"> 738</a>       <font color="#444444">/* Set the object type to ParCSR */</font>
<a name="line739"> 739</a>       <font color="#2040a0">HYPRE_SStructVectorSetObjectType</font><font color="4444FF">(</font><font color="#2040a0">xcoord</font>, <font color="#2040a0">HYPRE_PARCSR</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line740"> 740</a>       <font color="#2040a0">HYPRE_SStructVectorSetObjectType</font><font color="4444FF">(</font><font color="#2040a0">ycoord</font>, <font color="#2040a0">HYPRE_PARCSR</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line741"> 741</a>       <font color="#2040a0">HYPRE_SStructVectorSetObjectType</font><font color="4444FF">(</font><font color="#2040a0">zcoord</font>, <font color="#2040a0">HYPRE_PARCSR</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line742"> 742</a>       <font color="#444444">/* Indicate that the vector coefficients are ready to be set */</font>
<a name="line743"> 743</a>       <font color="#2040a0">HYPRE_SStructVectorInitialize</font><font color="4444FF">(</font><font color="#2040a0">xcoord</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line744"> 744</a>       <font color="#2040a0">HYPRE_SStructVectorInitialize</font><font color="4444FF">(</font><font color="#2040a0">ycoord</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line745"> 745</a>       <font color="#2040a0">HYPRE_SStructVectorInitialize</font><font color="4444FF">(</font><font color="#2040a0">zcoord</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line746"> 746</a> 
<a name="line747"> 747</a>       <font color="#444444">/* Compute and set the coordinates of the nodes */</font>
<a name="line748"> 748</a>       <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">i</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">i</font> <font color="4444FF">&lt;</font><font color="4444FF">=</font> <font color="#2040a0">n</font><font color="4444FF">;</font> <font color="#2040a0">i</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line749"> 749</a>          <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">j</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">j</font> <font color="4444FF">&lt;</font><font color="4444FF">=</font> <font color="#2040a0">n</font><font color="4444FF">;</font> <font color="#2040a0">j</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line750"> 750</a>             <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">k</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">k</font> <font color="4444FF">&lt;</font><font color="4444FF">=</font> <font color="#2040a0">n</font><font color="4444FF">;</font> <font color="#2040a0">k</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line751"> 751</a>             <font color="4444FF"><strong>{</strong></font>
<a name="line752"> 752</a>                <font color="#2040a0">index</font><font color="4444FF">[</font><font color="#FF0000">0</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#2040a0">i</font> <font color="4444FF">+</font> <font color="#2040a0">pi</font><font color="4444FF">*</font><font color="#2040a0">n</font><font color="4444FF">;</font> <font color="#2040a0">index</font><font color="4444FF">[</font><font color="#FF0000">1</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#2040a0">j</font> <font color="4444FF">+</font> <font color="#2040a0">pj</font><font color="4444FF">*</font><font color="#2040a0">n</font><font color="4444FF">;</font> <font color="#2040a0">index</font><font color="4444FF">[</font><font color="#FF0000">2</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#2040a0">k</font> <font color="4444FF">+</font> <font color="#2040a0">pk</font><font color="4444FF">*</font><font color="#2040a0">n</font><font color="4444FF">;</font>
<a name="line753"> 753</a> 
<a name="line754"> 754</a>                <font color="#2040a0">xval</font> <font color="4444FF">=</font> <font color="#2040a0">index</font><font color="4444FF">[</font><font color="#FF0000">0</font><font color="4444FF">]</font><font color="4444FF">*</font><font color="#2040a0">h</font><font color="4444FF">;</font>
<a name="line755"> 755</a>                <font color="#2040a0">yval</font> <font color="4444FF">=</font> <font color="#2040a0">index</font><font color="4444FF">[</font><font color="#FF0000">1</font><font color="4444FF">]</font><font color="4444FF">*</font><font color="#2040a0">h</font><font color="4444FF">;</font>
<a name="line756"> 756</a>                <font color="#2040a0">zval</font> <font color="4444FF">=</font> <font color="#2040a0">index</font><font color="4444FF">[</font><font color="#FF0000">2</font><font color="4444FF">]</font><font color="4444FF">*</font><font color="#2040a0">h</font><font color="4444FF">;</font>
<a name="line757"> 757</a> 
<a name="line758"> 758</a>                <font color="#2040a0">HYPRE_SStructVectorSetValues</font><font color="4444FF">(</font><font color="#2040a0">xcoord</font>, <font color="#2040a0">part</font>, <font color="#2040a0">index</font>, <font color="#2040a0">var</font>, <font color="4444FF">&amp;</font><font color="#2040a0">xval</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line759"> 759</a>                <font color="#2040a0">HYPRE_SStructVectorSetValues</font><font color="4444FF">(</font><font color="#2040a0">ycoord</font>, <font color="#2040a0">part</font>, <font color="#2040a0">index</font>, <font color="#2040a0">var</font>, <font color="4444FF">&amp;</font><font color="#2040a0">yval</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line760"> 760</a>                <font color="#2040a0">HYPRE_SStructVectorSetValues</font><font color="4444FF">(</font><font color="#2040a0">zcoord</font>, <font color="#2040a0">part</font>, <font color="#2040a0">index</font>, <font color="#2040a0">var</font>, <font color="4444FF">&amp;</font><font color="#2040a0">zval</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line761"> 761</a>             <font color="4444FF"><strong>}</strong></font>
<a name="line762"> 762</a> 
<a name="line763"> 763</a>       <font color="#444444">/* Finalize the vector assembly */</font>
<a name="line764"> 764</a>       <font color="#2040a0">HYPRE_SStructVectorAssemble</font><font color="4444FF">(</font><font color="#2040a0">xcoord</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line765"> 765</a>       <font color="#2040a0">HYPRE_SStructVectorAssemble</font><font color="4444FF">(</font><font color="#2040a0">ycoord</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line766"> 766</a>       <font color="#2040a0">HYPRE_SStructVectorAssemble</font><font color="4444FF">(</font><font color="#2040a0">zcoord</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line767"> 767</a>    <font color="4444FF"><strong>}</strong></font>
<a name="line768"> 768</a> 
<a name="line769"> 769</a>    <font color="#444444">/* 5. Set up a SStruct Vector for the solution vector x */</font>
<a name="line770"> 770</a>    <font color="4444FF"><strong>{</strong></font>
<a name="line771"> 771</a>       <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">part</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font>
<a name="line772"> 772</a>       <strong>int</strong> <font color="#2040a0">nvalues</font> <font color="4444FF">=</font> <font color="#2040a0">n</font><font color="4444FF">*</font><font color="4444FF">(</font><font color="#2040a0">n</font><font color="4444FF">+</font><font color="#FF0000">1</font><font color="4444FF">)</font><font color="4444FF">*</font><font color="4444FF">(</font><font color="#2040a0">n</font><font color="4444FF">+</font><font color="#FF0000">1</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line773"> 773</a>       <strong>double</strong> <font color="4444FF">*</font><font color="#2040a0">values</font><font color="4444FF">;</font>
<a name="line774"> 774</a> 
<a name="line775"> 775</a>       <font color="#2040a0">values</font> <font color="4444FF">=</font> <font color="#2040a0">calloc</font><font color="4444FF">(</font><font color="#2040a0">nvalues</font>, <strong>sizeof</strong><font color="4444FF">(</font><strong>double</strong><font color="4444FF">)</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line776"> 776</a> 
<a name="line777"> 777</a>       <font color="#444444">/* Create an empty vector object */</font>
<a name="line778"> 778</a>       <font color="#2040a0">HYPRE_SStructVectorCreate</font><font color="4444FF">(</font><font color="#2040a0">MPI_COMM_WORLD</font>, <font color="#2040a0">edge_grid</font>, <font color="4444FF">&amp;</font><font color="#2040a0">x</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line779"> 779</a>       <font color="#444444">/* Set the object type to ParCSR */</font>
<a name="line780"> 780</a>       <font color="#2040a0">HYPRE_SStructVectorSetObjectType</font><font color="4444FF">(</font><font color="#2040a0">x</font>, <font color="#2040a0">HYPRE_PARCSR</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line781"> 781</a>       <font color="#444444">/* Indicate that the vector coefficients are ready to be set */</font>
<a name="line782"> 782</a>       <font color="#2040a0">HYPRE_SStructVectorInitialize</font><font color="4444FF">(</font><font color="#2040a0">x</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line783"> 783</a> 
<a name="line784"> 784</a>       <font color="#444444">/* Set the values for the initial guess x-edge */</font>
<a name="line785"> 785</a>       <font color="4444FF"><strong>{</strong></font>
<a name="line786"> 786</a>          <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">var</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font>
<a name="line787"> 787</a>          <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">ilower</font><font color="4444FF">[</font><font color="#FF0000">3</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF"><strong>{</strong></font><font color="#FF0000">1</font> <font color="4444FF">+</font> <font color="#2040a0">pi</font><font color="4444FF">*</font><font color="#2040a0">n</font>, <font color="#FF0000">0</font> <font color="4444FF">+</font> <font color="#2040a0">pj</font><font color="4444FF">*</font><font color="#2040a0">n</font>, <font color="#FF0000">0</font> <font color="4444FF">+</font> <font color="#2040a0">pk</font><font color="4444FF">*</font><font color="#2040a0">n</font><font color="4444FF"><strong>}</strong></font><font color="4444FF">;</font>
<a name="line788"> 788</a>          <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">iupper</font><font color="4444FF">[</font><font color="#FF0000">3</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF"><strong>{</strong></font><font color="#2040a0">n</font> <font color="4444FF">+</font> <font color="#2040a0">pi</font><font color="4444FF">*</font><font color="#2040a0">n</font>, <font color="#2040a0">n</font> <font color="4444FF">+</font> <font color="#2040a0">pj</font><font color="4444FF">*</font><font color="#2040a0">n</font>, <font color="#2040a0">n</font> <font color="4444FF">+</font> <font color="#2040a0">pk</font><font color="4444FF">*</font><font color="#2040a0">n</font><font color="4444FF"><strong>}</strong></font><font color="4444FF">;</font>
<a name="line789"> 789</a>          <font color="#2040a0">HYPRE_SStructVectorSetBoxValues</font><font color="4444FF">(</font><font color="#2040a0">x</font>, <font color="#2040a0">part</font>, <font color="#2040a0">ilower</font>, <font color="#2040a0">iupper</font>, <font color="#2040a0">var</font>, <font color="#2040a0">values</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line790"> 790</a>       <font color="4444FF"><strong>}</strong></font>
<a name="line791"> 791</a>       <font color="#444444">/* Set the values for the initial guess y-edge */</font>
<a name="line792"> 792</a>       <font color="4444FF"><strong>{</strong></font>
<a name="line793"> 793</a>          <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">var</font> <font color="4444FF">=</font> <font color="#FF0000">1</font><font color="4444FF">;</font>
<a name="line794"> 794</a>          <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">ilower</font><font color="4444FF">[</font><font color="#FF0000">3</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF"><strong>{</strong></font><font color="#FF0000">0</font> <font color="4444FF">+</font> <font color="#2040a0">pi</font><font color="4444FF">*</font><font color="#2040a0">n</font>, <font color="#FF0000">1</font> <font color="4444FF">+</font> <font color="#2040a0">pj</font><font color="4444FF">*</font><font color="#2040a0">n</font>, <font color="#FF0000">0</font> <font color="4444FF">+</font> <font color="#2040a0">pk</font><font color="4444FF">*</font><font color="#2040a0">n</font><font color="4444FF"><strong>}</strong></font><font color="4444FF">;</font>
<a name="line795"> 795</a>          <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">iupper</font><font color="4444FF">[</font><font color="#FF0000">3</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF"><strong>{</strong></font><font color="#2040a0">n</font> <font color="4444FF">+</font> <font color="#2040a0">pi</font><font color="4444FF">*</font><font color="#2040a0">n</font>, <font color="#2040a0">n</font> <font color="4444FF">+</font> <font color="#2040a0">pj</font><font color="4444FF">*</font><font color="#2040a0">n</font>, <font color="#2040a0">n</font> <font color="4444FF">+</font> <font color="#2040a0">pk</font><font color="4444FF">*</font><font color="#2040a0">n</font><font color="4444FF"><strong>}</strong></font><font color="4444FF">;</font>
<a name="line796"> 796</a>          <font color="#2040a0">HYPRE_SStructVectorSetBoxValues</font><font color="4444FF">(</font><font color="#2040a0">x</font>, <font color="#2040a0">part</font>, <font color="#2040a0">ilower</font>, <font color="#2040a0">iupper</font>, <font color="#2040a0">var</font>, <font color="#2040a0">values</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line797"> 797</a>       <font color="4444FF"><strong>}</strong></font>
<a name="line798"> 798</a>       <font color="#444444">/* Set the values for the initial guess z-edge */</font>
<a name="line799"> 799</a>       <font color="4444FF"><strong>{</strong></font>
<a name="line800"> 800</a>          <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">var</font> <font color="4444FF">=</font> <font color="#FF0000">2</font><font color="4444FF">;</font>
<a name="line801"> 801</a>          <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">ilower</font><font color="4444FF">[</font><font color="#FF0000">3</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF"><strong>{</strong></font><font color="#FF0000">0</font> <font color="4444FF">+</font> <font color="#2040a0">pi</font><font color="4444FF">*</font><font color="#2040a0">n</font>, <font color="#FF0000">0</font> <font color="4444FF">+</font> <font color="#2040a0">pj</font><font color="4444FF">*</font><font color="#2040a0">n</font>, <font color="#FF0000">1</font> <font color="4444FF">+</font> <font color="#2040a0">pk</font><font color="4444FF">*</font><font color="#2040a0">n</font><font color="4444FF"><strong>}</strong></font><font color="4444FF">;</font>
<a name="line802"> 802</a>          <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">iupper</font><font color="4444FF">[</font><font color="#FF0000">3</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF"><strong>{</strong></font><font color="#2040a0">n</font> <font color="4444FF">+</font> <font color="#2040a0">pi</font><font color="4444FF">*</font><font color="#2040a0">n</font>, <font color="#2040a0">n</font> <font color="4444FF">+</font> <font color="#2040a0">pj</font><font color="4444FF">*</font><font color="#2040a0">n</font>, <font color="#2040a0">n</font> <font color="4444FF">+</font> <font color="#2040a0">pk</font><font color="4444FF">*</font><font color="#2040a0">n</font><font color="4444FF"><strong>}</strong></font><font color="4444FF">;</font>
<a name="line803"> 803</a>          <font color="#2040a0">HYPRE_SStructVectorSetBoxValues</font><font color="4444FF">(</font><font color="#2040a0">x</font>, <font color="#2040a0">part</font>, <font color="#2040a0">ilower</font>, <font color="#2040a0">iupper</font>, <font color="#2040a0">var</font>, <font color="#2040a0">values</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line804"> 804</a>       <font color="4444FF"><strong>}</strong></font>
<a name="line805"> 805</a> 
<a name="line806"> 806</a>       <font color="#2040a0">free</font><font color="4444FF">(</font><font color="#2040a0">values</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line807"> 807</a> 
<a name="line808"> 808</a>       <font color="#444444">/* Finalize the vector assembly */</font>
<a name="line809"> 809</a>       <font color="#2040a0">HYPRE_SStructVectorAssemble</font><font color="4444FF">(</font><font color="#2040a0">x</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line810"> 810</a>    <font color="4444FF"><strong>}</strong></font>
<a name="line811"> 811</a> 
<a name="line812"> 812</a>    <font color="#444444">/* Finalize current timing */</font>
<a name="line813"> 813</a>    <font color="#2040a0">hypre_EndTiming</font><font color="4444FF">(</font><font color="#2040a0">time_index</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line814"> 814</a>    <font color="#2040a0">hypre_PrintTiming</font><font color="4444FF">(</font><font color="#008000">&quot;SStruct phase times&quot;</font>, <font color="#2040a0">MPI_COMM_WORLD</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line815"> 815</a>    <font color="#2040a0">hypre_FinalizeTiming</font><font color="4444FF">(</font><font color="#2040a0">time_index</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line816"> 816</a>    <font color="#2040a0">hypre_ClearTiming</font><font color="4444FF">(</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line817"> 817</a> 
<a name="line818"> 818</a>    <font color="#444444">/* 6. Set up and call the PCG-AMS solver (Solver options can be found in the
<a name="line819"> 819</a>          Reference Manual.) */</font>
<a name="line820"> 820</a>    <font color="4444FF"><strong>{</strong></font>
<a name="line821"> 821</a>       <strong>double</strong> <font color="#2040a0">final_res_norm</font><font color="4444FF">;</font>
<a name="line822"> 822</a>       <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">its</font><font color="4444FF">;</font>
<a name="line823"> 823</a> 
<a name="line824"> 824</a>       <font color="#2040a0">HYPRE_ParCSRMatrix</font>    <font color="#2040a0">par_A</font><font color="4444FF">;</font>
<a name="line825"> 825</a>       <font color="#2040a0">HYPRE_ParVector</font>       <font color="#2040a0">par_b</font><font color="4444FF">;</font>
<a name="line826"> 826</a>       <font color="#2040a0">HYPRE_ParVector</font>       <font color="#2040a0">par_x</font><font color="4444FF">;</font>
<a name="line827"> 827</a> 
<a name="line828"> 828</a>       <font color="#2040a0">HYPRE_ParCSRMatrix</font>    <font color="#2040a0">par_G</font><font color="4444FF">;</font>
<a name="line829"> 829</a>       <font color="#2040a0">HYPRE_ParVector</font>       <font color="#2040a0">par_xcoord</font><font color="4444FF">;</font>
<a name="line830"> 830</a>       <font color="#2040a0">HYPRE_ParVector</font>       <font color="#2040a0">par_ycoord</font><font color="4444FF">;</font>
<a name="line831"> 831</a>       <font color="#2040a0">HYPRE_ParVector</font>       <font color="#2040a0">par_zcoord</font><font color="4444FF">;</font>
<a name="line832"> 832</a> 
<a name="line833"> 833</a>       <font color="#444444">/* Extract the ParCSR objects needed in the solver */</font>
<a name="line834"> 834</a>       <font color="#2040a0">HYPRE_SStructMatrixGetObject</font><font color="4444FF">(</font><font color="#2040a0">A</font>, <font color="4444FF">(</font><strong>void</strong> <font color="4444FF">*</font><font color="4444FF">*</font><font color="4444FF">)</font> <font color="4444FF">&amp;</font><font color="#2040a0">par_A</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line835"> 835</a>       <font color="#2040a0">HYPRE_SStructVectorGetObject</font><font color="4444FF">(</font><font color="#2040a0">b</font>, <font color="4444FF">(</font><strong>void</strong> <font color="4444FF">*</font><font color="4444FF">*</font><font color="4444FF">)</font> <font color="4444FF">&amp;</font><font color="#2040a0">par_b</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line836"> 836</a>       <font color="#2040a0">HYPRE_SStructVectorGetObject</font><font color="4444FF">(</font><font color="#2040a0">x</font>, <font color="4444FF">(</font><strong>void</strong> <font color="4444FF">*</font><font color="4444FF">*</font><font color="4444FF">)</font> <font color="4444FF">&amp;</font><font color="#2040a0">par_x</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line837"> 837</a>       <font color="#2040a0">HYPRE_SStructMatrixGetObject</font><font color="4444FF">(</font><font color="#2040a0">G</font>, <font color="4444FF">(</font><strong>void</strong> <font color="4444FF">*</font><font color="4444FF">*</font><font color="4444FF">)</font> <font color="4444FF">&amp;</font><font color="#2040a0">par_G</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line838"> 838</a>       <font color="#2040a0">HYPRE_SStructVectorGetObject</font><font color="4444FF">(</font><font color="#2040a0">xcoord</font>, <font color="4444FF">(</font><strong>void</strong> <font color="4444FF">*</font><font color="4444FF">*</font><font color="4444FF">)</font> <font color="4444FF">&amp;</font><font color="#2040a0">par_xcoord</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line839"> 839</a>       <font color="#2040a0">HYPRE_SStructVectorGetObject</font><font color="4444FF">(</font><font color="#2040a0">ycoord</font>, <font color="4444FF">(</font><strong>void</strong> <font color="4444FF">*</font><font color="4444FF">*</font><font color="4444FF">)</font> <font color="4444FF">&amp;</font><font color="#2040a0">par_ycoord</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line840"> 840</a>       <font color="#2040a0">HYPRE_SStructVectorGetObject</font><font color="4444FF">(</font><font color="#2040a0">zcoord</font>, <font color="4444FF">(</font><strong>void</strong> <font color="4444FF">*</font><font color="4444FF">*</font><font color="4444FF">)</font> <font color="4444FF">&amp;</font><font color="#2040a0">par_zcoord</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line841"> 841</a> 
<a name="line842"> 842</a>       <strong>if</strong> <font color="4444FF">(</font><font color="#2040a0">myid</font> <font color="4444FF">=</font><font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">)</font>
<a name="line843"> 843</a>          <font color="#2040a0">printf</font><font color="4444FF">(</font><font color="#008000">&quot;Problem size: %lld<font color="#77dd77">\n</font><font color="#77dd77">\n</font>&quot;</font>,
<a name="line844"> 844</a>              <font color="#2040a0">hypre_ParCSRMatrixGlobalNumRows</font><font color="4444FF">(</font><font color="4444FF">(</font><font color="#2040a0">hypre_ParCSRMatrix</font><font color="4444FF">*</font><font color="4444FF">)</font><font color="#2040a0">par_A</font><font color="4444FF">)</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line845"> 845</a> 
<a name="line846"> 846</a>       <font color="#444444">/* Start timing */</font>
<a name="line847"> 847</a>       <font color="#2040a0">time_index</font> <font color="4444FF">=</font> <font color="#2040a0">hypre_InitializeTiming</font><font color="4444FF">(</font><font color="#008000">&quot;AMS Setup&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line848"> 848</a>       <font color="#2040a0">hypre_BeginTiming</font><font color="4444FF">(</font><font color="#2040a0">time_index</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line849"> 849</a> 
<a name="line850"> 850</a>       <font color="#444444">/* Create solver */</font>
<a name="line851"> 851</a>       <font color="#2040a0">HYPRE_ParCSRPCGCreate</font><font color="4444FF">(</font><font color="#2040a0">MPI_COMM_WORLD</font>, <font color="4444FF">&amp;</font><font color="#2040a0">solver</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line852"> 852</a> 
<a name="line853"> 853</a>       <font color="#444444">/* Set some parameters (See Reference Manual for more parameters) */</font>
<a name="line854"> 854</a>       <font color="#2040a0">HYPRE_PCGSetMaxIter</font><font color="4444FF">(</font><font color="#2040a0">solver</font>, <font color="#2040a0">maxit</font><font color="4444FF">)</font><font color="4444FF">;</font> <font color="#444444">/* max iterations */</font>
<a name="line855"> 855</a>       <font color="#2040a0">HYPRE_PCGSetTol</font><font color="4444FF">(</font><font color="#2040a0">solver</font>, <font color="#2040a0">tol</font><font color="4444FF">)</font><font color="4444FF">;</font> <font color="#444444">/* conv. tolerance */</font>
<a name="line856"> 856</a>       <font color="#2040a0">HYPRE_PCGSetTwoNorm</font><font color="4444FF">(</font><font color="#2040a0">solver</font>, <font color="#FF0000">0</font><font color="4444FF">)</font><font color="4444FF">;</font> <font color="#444444">/* use the two norm as the stopping criteria */</font>
<a name="line857"> 857</a>       <font color="#2040a0">HYPRE_PCGSetPrintLevel</font><font color="4444FF">(</font><font color="#2040a0">solver</font>, <font color="#FF0000">2</font><font color="4444FF">)</font><font color="4444FF">;</font> <font color="#444444">/* print solve info */</font>
<a name="line858"> 858</a>       <font color="#2040a0">HYPRE_PCGSetLogging</font><font color="4444FF">(</font><font color="#2040a0">solver</font>, <font color="#FF0000">1</font><font color="4444FF">)</font><font color="4444FF">;</font> <font color="#444444">/* needed to get run info later */</font>
<a name="line859"> 859</a> 
<a name="line860"> 860</a>       <font color="#444444">/* Create AMS preconditioner */</font>
<a name="line861"> 861</a>       <font color="#2040a0">HYPRE_AMSCreate</font><font color="4444FF">(</font><font color="4444FF">&amp;</font><font color="#2040a0">precond</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line862"> 862</a> 
<a name="line863"> 863</a>       <font color="#444444">/* Set AMS parameters */</font>
<a name="line864"> 864</a>       <font color="#2040a0">HYPRE_AMSSetMaxIter</font><font color="4444FF">(</font><font color="#2040a0">precond</font>, <font color="#FF0000">1</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line865"> 865</a>       <font color="#2040a0">HYPRE_AMSSetTol</font><font color="4444FF">(</font><font color="#2040a0">precond</font>, <font color="#FF0000">0.0</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line866"> 866</a>       <font color="#2040a0">HYPRE_AMSSetCycleType</font><font color="4444FF">(</font><font color="#2040a0">precond</font>, <font color="#2040a0">cycle_type</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line867"> 867</a>       <font color="#2040a0">HYPRE_AMSSetPrintLevel</font><font color="4444FF">(</font><font color="#2040a0">precond</font>, <font color="#FF0000">1</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line868"> 868</a> 
<a name="line869"> 869</a>       <font color="#444444">/* Set discrete gradient */</font>
<a name="line870"> 870</a>       <font color="#2040a0">HYPRE_AMSSetDiscreteGradient</font><font color="4444FF">(</font><font color="#2040a0">precond</font>, <font color="#2040a0">par_G</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line871"> 871</a> 
<a name="line872"> 872</a>       <font color="#444444">/* Set vertex coordinates */</font>
<a name="line873"> 873</a>       <font color="#2040a0">HYPRE_AMSSetCoordinateVectors</font><font color="4444FF">(</font><font color="#2040a0">precond</font>,
<a name="line874"> 874</a>                                     <font color="#2040a0">par_xcoord</font>, <font color="#2040a0">par_ycoord</font>, <font color="#2040a0">par_zcoord</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line875"> 875</a> 
<a name="line876"> 876</a>       <strong>if</strong> <font color="4444FF">(</font><font color="#2040a0">singular_problem</font><font color="4444FF">)</font>
<a name="line877"> 877</a>          <font color="#2040a0">HYPRE_AMSSetBetaPoissonMatrix</font><font color="4444FF">(</font><font color="#2040a0">precond</font>, <font color="#2040a0">NULL</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line878"> 878</a> 
<a name="line879"> 879</a>       <font color="#444444">/* Smoothing and AMG options */</font>
<a name="line880"> 880</a>       <font color="#2040a0">HYPRE_AMSSetSmoothingOptions</font><font color="4444FF">(</font><font color="#2040a0">precond</font>,
<a name="line881"> 881</a>                                    <font color="#2040a0">rlx_type</font>, <font color="#2040a0">rlx_sweeps</font>,
<a name="line882"> 882</a>                                    <font color="#2040a0">rlx_weight</font>, <font color="#2040a0">rlx_omega</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line883"> 883</a>       <font color="#2040a0">HYPRE_AMSSetAlphaAMGOptions</font><font color="4444FF">(</font><font color="#2040a0">precond</font>,
<a name="line884"> 884</a>                                   <font color="#2040a0">amg_coarsen_type</font>, <font color="#2040a0">amg_agg_levels</font>,
<a name="line885"> 885</a>                                   <font color="#2040a0">amg_rlx_type</font>, <font color="#2040a0">theta</font>, <font color="#2040a0">amg_interp_type</font>,
<a name="line886"> 886</a>                                   <font color="#2040a0">amg_Pmax</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line887"> 887</a>       <font color="#2040a0">HYPRE_AMSSetBetaAMGOptions</font><font color="4444FF">(</font><font color="#2040a0">precond</font>,
<a name="line888"> 888</a>                                  <font color="#2040a0">amg_coarsen_type</font>, <font color="#2040a0">amg_agg_levels</font>,
<a name="line889"> 889</a>                                  <font color="#2040a0">amg_rlx_type</font>, <font color="#2040a0">theta</font>, <font color="#2040a0">amg_interp_type</font>,
<a name="line890"> 890</a>                                  <font color="#2040a0">amg_Pmax</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line891"> 891</a> 
<a name="line892"> 892</a>       <font color="#444444">/* Set the PCG preconditioner */</font>
<a name="line893"> 893</a>       <font color="#2040a0">HYPRE_PCGSetPrecond</font><font color="4444FF">(</font><font color="#2040a0">solver</font>,
<a name="line894"> 894</a>                           <font color="4444FF">(</font><font color="#2040a0">HYPRE_PtrToSolverFcn</font><font color="4444FF">)</font> <font color="#2040a0">HYPRE_AMSSolve</font>,
<a name="line895"> 895</a>                           <font color="4444FF">(</font><font color="#2040a0">HYPRE_PtrToSolverFcn</font><font color="4444FF">)</font> <font color="#2040a0">HYPRE_AMSSetup</font>,
<a name="line896"> 896</a>                           <font color="#2040a0">precond</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line897"> 897</a> 
<a name="line898"> 898</a>       <font color="#444444">/* Call the setup */</font>
<a name="line899"> 899</a>       <font color="#2040a0">HYPRE_ParCSRPCGSetup</font><font color="4444FF">(</font><font color="#2040a0">solver</font>, <font color="#2040a0">par_A</font>, <font color="#2040a0">par_b</font>, <font color="#2040a0">par_x</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line900"> 900</a> 
<a name="line901"> 901</a>       <font color="#444444">/* Finalize current timing */</font>
<a name="line902"> 902</a>       <font color="#2040a0">hypre_EndTiming</font><font color="4444FF">(</font><font color="#2040a0">time_index</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line903"> 903</a>       <font color="#2040a0">hypre_PrintTiming</font><font color="4444FF">(</font><font color="#008000">&quot;Setup phase times&quot;</font>, <font color="#2040a0">MPI_COMM_WORLD</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line904"> 904</a>       <font color="#2040a0">hypre_FinalizeTiming</font><font color="4444FF">(</font><font color="#2040a0">time_index</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line905"> 905</a>       <font color="#2040a0">hypre_ClearTiming</font><font color="4444FF">(</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line906"> 906</a> 
<a name="line907"> 907</a>       <font color="#444444">/* Start timing again */</font>
<a name="line908"> 908</a>       <font color="#2040a0">time_index</font> <font color="4444FF">=</font> <font color="#2040a0">hypre_InitializeTiming</font><font color="4444FF">(</font><font color="#008000">&quot;AMS Solve&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line909"> 909</a>       <font color="#2040a0">hypre_BeginTiming</font><font color="4444FF">(</font><font color="#2040a0">time_index</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line910"> 910</a> 
<a name="line911"> 911</a>       <font color="#444444">/* Call the solve */</font>
<a name="line912"> 912</a>       <font color="#2040a0">HYPRE_ParCSRPCGSolve</font><font color="4444FF">(</font><font color="#2040a0">solver</font>, <font color="#2040a0">par_A</font>, <font color="#2040a0">par_b</font>, <font color="#2040a0">par_x</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line913"> 913</a> 
<a name="line914"> 914</a>       <font color="#444444">/* Finalize current timing */</font>
<a name="line915"> 915</a>       <font color="#2040a0">hypre_EndTiming</font><font color="4444FF">(</font><font color="#2040a0">time_index</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line916"> 916</a>       <font color="#2040a0">hypre_PrintTiming</font><font color="4444FF">(</font><font color="#008000">&quot;Solve phase times&quot;</font>, <font color="#2040a0">MPI_COMM_WORLD</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line917"> 917</a>       <font color="#2040a0">hypre_FinalizeTiming</font><font color="4444FF">(</font><font color="#2040a0">time_index</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line918"> 918</a>       <font color="#2040a0">hypre_ClearTiming</font><font color="4444FF">(</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line919"> 919</a> 
<a name="line920"> 920</a>       <font color="#444444">/* Get some info */</font>
<a name="line921"> 921</a>       <font color="#2040a0">HYPRE_PCGGetNumIterations</font><font color="4444FF">(</font><font color="#2040a0">solver</font>, <font color="4444FF">&amp;</font><font color="#2040a0">its</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line922"> 922</a>       <font color="#2040a0">HYPRE_PCGGetFinalRelativeResidualNorm</font><font color="4444FF">(</font><font color="#2040a0">solver</font>, <font color="4444FF">&amp;</font><font color="#2040a0">final_res_norm</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line923"> 923</a> 
<a name="line924"> 924</a>       <font color="#444444">/* Clean up */</font>
<a name="line925"> 925</a>       <font color="#2040a0">HYPRE_AMSDestroy</font><font color="4444FF">(</font><font color="#2040a0">precond</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line926"> 926</a>       <font color="#2040a0">HYPRE_ParCSRPCGDestroy</font><font color="4444FF">(</font><font color="#2040a0">solver</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line927"> 927</a> 
<a name="line928"> 928</a>       <font color="#444444">/* Gather the solution vector */</font>
<a name="line929"> 929</a>       <font color="#2040a0">HYPRE_SStructVectorGather</font><font color="4444FF">(</font><font color="#2040a0">x</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line930"> 930</a> 
<a name="line931"> 931</a>       <font color="#444444">/* Print the solution with replicated shared data */</font>
<a name="line932"> 932</a>       <strong>if</strong> <font color="4444FF">(</font><font color="#2040a0">print_solution</font><font color="4444FF">)</font>
<a name="line933"> 933</a>       <font color="4444FF"><strong>{</strong></font>
<a name="line934"> 934</a>          <font color="#2040a0">FILE</font> <font color="4444FF">*</font><font color="#2040a0">file</font><font color="4444FF">;</font>
<a name="line935"> 935</a>          <strong>char</strong>  <font color="#2040a0">filename</font><font color="4444FF">[</font><font color="#FF0000">255</font><font color="4444FF">]</font><font color="4444FF">;</font>
<a name="line936"> 936</a> 
<a name="line937"> 937</a>          <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">part</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font>
<a name="line938"> 938</a>          <strong>int</strong> <font color="#2040a0">nvalues</font> <font color="4444FF">=</font> <font color="#2040a0">n</font><font color="4444FF">*</font><font color="4444FF">(</font><font color="#2040a0">n</font><font color="4444FF">+</font><font color="#FF0000">1</font><font color="4444FF">)</font><font color="4444FF">*</font><font color="4444FF">(</font><font color="#2040a0">n</font><font color="4444FF">+</font><font color="#FF0000">1</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line939"> 939</a>          <strong>double</strong> <font color="4444FF">*</font><font color="#2040a0">xvalues</font>, <font color="4444FF">*</font><font color="#2040a0">yvalues</font>, <font color="4444FF">*</font><font color="#2040a0">zvalues</font><font color="4444FF">;</font>
<a name="line940"> 940</a> 
<a name="line941"> 941</a>          <font color="#2040a0">xvalues</font> <font color="4444FF">=</font> <font color="#2040a0">calloc</font><font color="4444FF">(</font><font color="#2040a0">nvalues</font>, <strong>sizeof</strong><font color="4444FF">(</font><strong>double</strong><font color="4444FF">)</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line942"> 942</a>          <font color="#2040a0">yvalues</font> <font color="4444FF">=</font> <font color="#2040a0">calloc</font><font color="4444FF">(</font><font color="#2040a0">nvalues</font>, <strong>sizeof</strong><font color="4444FF">(</font><strong>double</strong><font color="4444FF">)</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line943"> 943</a>          <font color="#2040a0">zvalues</font> <font color="4444FF">=</font> <font color="#2040a0">calloc</font><font color="4444FF">(</font><font color="#2040a0">nvalues</font>, <strong>sizeof</strong><font color="4444FF">(</font><strong>double</strong><font color="4444FF">)</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line944"> 944</a> 
<a name="line945"> 945</a>          <font color="#444444">/* Get local solution in the x-edges */</font>
<a name="line946"> 946</a>          <font color="4444FF"><strong>{</strong></font>
<a name="line947"> 947</a>             <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">var</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font>
<a name="line948"> 948</a>             <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">ilower</font><font color="4444FF">[</font><font color="#FF0000">3</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF"><strong>{</strong></font><font color="#FF0000">1</font> <font color="4444FF">+</font> <font color="#2040a0">pi</font><font color="4444FF">*</font><font color="#2040a0">n</font>, <font color="#FF0000">0</font> <font color="4444FF">+</font> <font color="#2040a0">pj</font><font color="4444FF">*</font><font color="#2040a0">n</font>, <font color="#FF0000">0</font> <font color="4444FF">+</font> <font color="#2040a0">pk</font><font color="4444FF">*</font><font color="#2040a0">n</font><font color="4444FF"><strong>}</strong></font><font color="4444FF">;</font>
<a name="line949"> 949</a>             <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">iupper</font><font color="4444FF">[</font><font color="#FF0000">3</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF"><strong>{</strong></font><font color="#2040a0">n</font> <font color="4444FF">+</font> <font color="#2040a0">pi</font><font color="4444FF">*</font><font color="#2040a0">n</font>, <font color="#2040a0">n</font> <font color="4444FF">+</font> <font color="#2040a0">pj</font><font color="4444FF">*</font><font color="#2040a0">n</font>, <font color="#2040a0">n</font> <font color="4444FF">+</font> <font color="#2040a0">pk</font><font color="4444FF">*</font><font color="#2040a0">n</font><font color="4444FF"><strong>}</strong></font><font color="4444FF">;</font>
<a name="line950"> 950</a>             <font color="#2040a0">HYPRE_SStructVectorGetBoxValues</font><font color="4444FF">(</font><font color="#2040a0">x</font>, <font color="#2040a0">part</font>, <font color="#2040a0">ilower</font>, <font color="#2040a0">iupper</font>,
<a name="line951"> 951</a>                                             <font color="#2040a0">var</font>, <font color="#2040a0">xvalues</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line952"> 952</a>          <font color="4444FF"><strong>}</strong></font>
<a name="line953"> 953</a>          <font color="#444444">/* Get local solution in the y-edges */</font>
<a name="line954"> 954</a>          <font color="4444FF"><strong>{</strong></font>
<a name="line955"> 955</a>             <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">var</font> <font color="4444FF">=</font> <font color="#FF0000">1</font><font color="4444FF">;</font>
<a name="line956"> 956</a>             <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">ilower</font><font color="4444FF">[</font><font color="#FF0000">3</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF"><strong>{</strong></font><font color="#FF0000">0</font> <font color="4444FF">+</font> <font color="#2040a0">pi</font><font color="4444FF">*</font><font color="#2040a0">n</font>, <font color="#FF0000">1</font> <font color="4444FF">+</font> <font color="#2040a0">pj</font><font color="4444FF">*</font><font color="#2040a0">n</font>, <font color="#FF0000">0</font> <font color="4444FF">+</font> <font color="#2040a0">pk</font><font color="4444FF">*</font><font color="#2040a0">n</font><font color="4444FF"><strong>}</strong></font><font color="4444FF">;</font>
<a name="line957"> 957</a>             <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">iupper</font><font color="4444FF">[</font><font color="#FF0000">3</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF"><strong>{</strong></font><font color="#2040a0">n</font> <font color="4444FF">+</font> <font color="#2040a0">pi</font><font color="4444FF">*</font><font color="#2040a0">n</font>, <font color="#2040a0">n</font> <font color="4444FF">+</font> <font color="#2040a0">pj</font><font color="4444FF">*</font><font color="#2040a0">n</font>, <font color="#2040a0">n</font> <font color="4444FF">+</font> <font color="#2040a0">pk</font><font color="4444FF">*</font><font color="#2040a0">n</font><font color="4444FF"><strong>}</strong></font><font color="4444FF">;</font>
<a name="line958"> 958</a>             <font color="#2040a0">HYPRE_SStructVectorGetBoxValues</font><font color="4444FF">(</font><font color="#2040a0">x</font>, <font color="#2040a0">part</font>, <font color="#2040a0">ilower</font>, <font color="#2040a0">iupper</font>,
<a name="line959"> 959</a>                                             <font color="#2040a0">var</font>, <font color="#2040a0">yvalues</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line960"> 960</a>          <font color="4444FF"><strong>}</strong></font>
<a name="line961"> 961</a>          <font color="#444444">/* Get local solution in the z-edges */</font>
<a name="line962"> 962</a>          <font color="4444FF"><strong>{</strong></font>
<a name="line963"> 963</a>             <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">var</font> <font color="4444FF">=</font> <font color="#FF0000">2</font><font color="4444FF">;</font>
<a name="line964"> 964</a>             <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">ilower</font><font color="4444FF">[</font><font color="#FF0000">3</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF"><strong>{</strong></font><font color="#FF0000">0</font> <font color="4444FF">+</font> <font color="#2040a0">pi</font><font color="4444FF">*</font><font color="#2040a0">n</font>, <font color="#FF0000">0</font> <font color="4444FF">+</font> <font color="#2040a0">pj</font><font color="4444FF">*</font><font color="#2040a0">n</font>, <font color="#FF0000">1</font> <font color="4444FF">+</font> <font color="#2040a0">pk</font><font color="4444FF">*</font><font color="#2040a0">n</font><font color="4444FF"><strong>}</strong></font><font color="4444FF">;</font>
<a name="line965"> 965</a>             <font color="#2040a0">HYPRE_Int</font> <font color="#2040a0">iupper</font><font color="4444FF">[</font><font color="#FF0000">3</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF"><strong>{</strong></font><font color="#2040a0">n</font> <font color="4444FF">+</font> <font color="#2040a0">pi</font><font color="4444FF">*</font><font color="#2040a0">n</font>, <font color="#2040a0">n</font> <font color="4444FF">+</font> <font color="#2040a0">pj</font><font color="4444FF">*</font><font color="#2040a0">n</font>, <font color="#2040a0">n</font> <font color="4444FF">+</font> <font color="#2040a0">pk</font><font color="4444FF">*</font><font color="#2040a0">n</font><font color="4444FF"><strong>}</strong></font><font color="4444FF">;</font>
<a name="line966"> 966</a>             <font color="#2040a0">HYPRE_SStructVectorGetBoxValues</font><font color="4444FF">(</font><font color="#2040a0">x</font>, <font color="#2040a0">part</font>, <font color="#2040a0">ilower</font>, <font color="#2040a0">iupper</font>,
<a name="line967"> 967</a>                                             <font color="#2040a0">var</font>, <font color="#2040a0">zvalues</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line968"> 968</a>          <font color="4444FF"><strong>}</strong></font>
<a name="line969"> 969</a> 
<a name="line970"> 970</a>          <font color="#2040a0">sprintf</font><font color="4444FF">(</font><font color="#2040a0">filename</font>, <font color="#008000">&quot;sstruct.out.x.00.00.%05d&quot;</font>, <font color="#2040a0">myid</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line971"> 971</a>          <strong>if</strong> <font color="4444FF">(</font><font color="4444FF">(</font><font color="#2040a0">file</font> <font color="4444FF">=</font> <font color="#2040a0">fopen</font><font color="4444FF">(</font><font color="#2040a0">filename</font>, <font color="#008000">&quot;w&quot;</font><font color="4444FF">)</font><font color="4444FF">)</font> <font color="4444FF">=</font><font color="4444FF">=</font> <font color="#2040a0">NULL</font><font color="4444FF">)</font>
<a name="line972"> 972</a>          <font color="4444FF"><strong>{</strong></font>
<a name="line973"> 973</a>             <font color="#2040a0">printf</font><font color="4444FF">(</font><font color="#008000">&quot;Error: can't open output file %s<font color="#77dd77">\n</font>&quot;</font>, <font color="#2040a0">filename</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line974"> 974</a>             <font color="#2040a0">MPI_Finalize</font><font color="4444FF">(</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line975"> 975</a>             <font color="#2040a0">exit</font><font color="4444FF">(</font><font color="#FF0000">1</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line976"> 976</a>          <font color="4444FF"><strong>}</strong></font>
<a name="line977"> 977</a> 
<a name="line978"> 978</a>          <font color="#444444">/* Save the edge values, element by element, using the same numbering
<a name="line979"> 979</a>             as the local finite element degrees of freedom. */</font>
<a name="line980"> 980</a>          <font color="4444FF"><strong>{</strong></font>
<a name="line981"> 981</a>             <strong>int</strong> <font color="#2040a0">i</font>, <font color="#2040a0">j</font>, <font color="#2040a0">k</font>, <font color="#2040a0">s</font><font color="4444FF">;</font>
<a name="line982"> 982</a> 
<a name="line983"> 983</a>             <font color="#444444">/* Initial x-, y- and z-edge indices in the values arrays */</font>
<a name="line984"> 984</a>             <strong>int</strong> <font color="#2040a0">oi</font><font color="4444FF">[</font><font color="#FF0000">4</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF"><strong>{</strong></font> <font color="#FF0000">0</font>, <font color="#2040a0">n</font>, <font color="#2040a0">n</font><font color="4444FF">*</font><font color="4444FF">(</font><font color="#2040a0">n</font><font color="4444FF">+</font><font color="#FF0000">1</font><font color="4444FF">)</font>, <font color="#2040a0">n</font><font color="4444FF">*</font><font color="4444FF">(</font><font color="#2040a0">n</font><font color="4444FF">+</font><font color="#FF0000">1</font><font color="4444FF">)</font><font color="4444FF">+</font><font color="#2040a0">n</font> <font color="4444FF"><strong>}</strong></font><font color="4444FF">;</font> <font color="#444444">/* e_0, e_2,  e_4,  e_6 */</font>
<a name="line985"> 985</a>             <strong>int</strong> <font color="#2040a0">oj</font><font color="4444FF">[</font><font color="#FF0000">4</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF"><strong>{</strong></font> <font color="#FF0000">0</font>, <font color="#FF0000">1</font>, <font color="#2040a0">n</font><font color="4444FF">*</font><font color="4444FF">(</font><font color="#2040a0">n</font><font color="4444FF">+</font><font color="#FF0000">1</font><font color="4444FF">)</font>, <font color="#2040a0">n</font><font color="4444FF">*</font><font color="4444FF">(</font><font color="#2040a0">n</font><font color="4444FF">+</font><font color="#FF0000">1</font><font color="4444FF">)</font><font color="4444FF">+</font><font color="#FF0000">1</font> <font color="4444FF"><strong>}</strong></font><font color="4444FF">;</font> <font color="#444444">/* e_3, e_1,  e_7,  e_5 */</font>
<a name="line986"> 986</a>             <strong>int</strong> <font color="#2040a0">ok</font><font color="4444FF">[</font><font color="#FF0000">4</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="4444FF"><strong>{</strong></font> <font color="#FF0000">0</font>, <font color="#FF0000">1</font>,     <font color="#2040a0">n</font><font color="4444FF">+</font><font color="#FF0000">1</font>,       <font color="#2040a0">n</font><font color="4444FF">+</font><font color="#FF0000">2</font> <font color="4444FF"><strong>}</strong></font><font color="4444FF">;</font> <font color="#444444">/* e_8, e_9, e_11, e_10 */</font>
<a name="line987"> 987</a>             <font color="#444444">/* Loop over the cells while updating the above offsets */</font>
<a name="line988"> 988</a>             <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">k</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">k</font> <font color="4444FF">&lt;</font> <font color="#2040a0">n</font><font color="4444FF">;</font> <font color="#2040a0">k</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line989"> 989</a>             <font color="4444FF"><strong>{</strong></font>
<a name="line990"> 990</a>                <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">j</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">j</font> <font color="4444FF">&lt;</font> <font color="#2040a0">n</font><font color="4444FF">;</font> <font color="#2040a0">j</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line991"> 991</a>                <font color="4444FF"><strong>{</strong></font>
<a name="line992"> 992</a>                   <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">i</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">i</font> <font color="4444FF">&lt;</font> <font color="#2040a0">n</font><font color="4444FF">;</font> <font color="#2040a0">i</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font>
<a name="line993"> 993</a>                   <font color="4444FF"><strong>{</strong></font>
<a name="line994"> 994</a>                      <font color="#2040a0">fprintf</font><font color="4444FF">(</font><font color="#2040a0">file</font>,
<a name="line995"> 995</a>                              <font color="#008000">&quot;%.14e<font color="#77dd77">\n</font>%.14e<font color="#77dd77">\n</font>%.14e<font color="#77dd77">\n</font>%.14e<font color="#77dd77">\n</font>&quot;</font>
<a name="line996"> 996</a>                              <font color="#008000">&quot;%.14e<font color="#77dd77">\n</font>%.14e<font color="#77dd77">\n</font>%.14e<font color="#77dd77">\n</font>%.14e<font color="#77dd77">\n</font>&quot;</font>
<a name="line997"> 997</a>                              <font color="#008000">&quot;%.14e<font color="#77dd77">\n</font>%.14e<font color="#77dd77">\n</font>%.14e<font color="#77dd77">\n</font>%.14e<font color="#77dd77">\n</font>&quot;</font>,
<a name="line998"> 998</a>                              <font color="#2040a0">xvalues</font><font color="4444FF">[</font><font color="#2040a0">oi</font><font color="4444FF">[</font><font color="#FF0000">0</font><font color="4444FF">]</font><font color="4444FF">]</font>, <font color="#2040a0">yvalues</font><font color="4444FF">[</font><font color="#2040a0">oj</font><font color="4444FF">[</font><font color="#FF0000">1</font><font color="4444FF">]</font><font color="4444FF">]</font>, <font color="#2040a0">xvalues</font><font color="4444FF">[</font><font color="#2040a0">oi</font><font color="4444FF">[</font><font color="#FF0000">1</font><font color="4444FF">]</font><font color="4444FF">]</font>, <font color="#2040a0">yvalues</font><font color="4444FF">[</font><font color="#2040a0">oj</font><font color="4444FF">[</font><font color="#FF0000">0</font><font color="4444FF">]</font><font color="4444FF">]</font>,
<a name="line999"> 999</a>                              <font color="#2040a0">xvalues</font><font color="4444FF">[</font><font color="#2040a0">oi</font><font color="4444FF">[</font><font color="#FF0000">2</font><font color="4444FF">]</font><font color="4444FF">]</font>, <font color="#2040a0">yvalues</font><font color="4444FF">[</font><font color="#2040a0">oj</font><font color="4444FF">[</font><font color="#FF0000">3</font><font color="4444FF">]</font><font color="4444FF">]</font>, <font color="#2040a0">xvalues</font><font color="4444FF">[</font><font color="#2040a0">oi</font><font color="4444FF">[</font><font color="#FF0000">3</font><font color="4444FF">]</font><font color="4444FF">]</font>, <font color="#2040a0">yvalues</font><font color="4444FF">[</font><font color="#2040a0">oj</font><font color="4444FF">[</font><font color="#FF0000">2</font><font color="4444FF">]</font><font color="4444FF">]</font>,
<a name="line1000">1000</a>                              <font color="#2040a0">zvalues</font><font color="4444FF">[</font><font color="#2040a0">ok</font><font color="4444FF">[</font><font color="#FF0000">0</font><font color="4444FF">]</font><font color="4444FF">]</font>, <font color="#2040a0">zvalues</font><font color="4444FF">[</font><font color="#2040a0">ok</font><font color="4444FF">[</font><font color="#FF0000">1</font><font color="4444FF">]</font><font color="4444FF">]</font>, <font color="#2040a0">zvalues</font><font color="4444FF">[</font><font color="#2040a0">ok</font><font color="4444FF">[</font><font color="#FF0000">3</font><font color="4444FF">]</font><font color="4444FF">]</font>, <font color="#2040a0">zvalues</font><font color="4444FF">[</font><font color="#2040a0">ok</font><font color="4444FF">[</font><font color="#FF0000">2</font><font color="4444FF">]</font><font color="4444FF">]</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line1001">1001</a> 
<a name="line1002">1002</a>                      <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">s</font><font color="4444FF">=</font><font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">s</font><font color="4444FF">&lt;</font><font color="#FF0000">4</font><font color="4444FF">;</font> <font color="#2040a0">s</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font> <font color="#2040a0">oi</font><font color="4444FF">[</font><font color="#2040a0">s</font><font color="4444FF">]</font><font color="4444FF">+</font><font color="4444FF">+</font>, <font color="#2040a0">oj</font><font color="4444FF">[</font><font color="#2040a0">s</font><font color="4444FF">]</font><font color="4444FF">+</font><font color="4444FF">+</font>, <font color="#2040a0">ok</font><font color="4444FF">[</font><font color="#2040a0">s</font><font color="4444FF">]</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">;</font>
<a name="line1003">1003</a>                   <font color="4444FF"><strong>}</strong></font>
<a name="line1004">1004</a>                   <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">s</font><font color="4444FF">=</font><font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">s</font><font color="4444FF">&lt;</font><font color="#FF0000">4</font><font color="4444FF">;</font> <font color="#2040a0">s</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font> <font color="#2040a0">oj</font><font color="4444FF">[</font><font color="#2040a0">s</font><font color="4444FF">]</font><font color="4444FF">+</font><font color="4444FF">+</font>, <font color="#2040a0">ok</font><font color="4444FF">[</font><font color="#2040a0">s</font><font color="4444FF">]</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">;</font>
<a name="line1005">1005</a>                <font color="4444FF"><strong>}</strong></font>
<a name="line1006">1006</a>                <strong>for</strong> <font color="4444FF">(</font><font color="#2040a0">s</font><font color="4444FF">=</font><font color="#FF0000">0</font><font color="4444FF">;</font> <font color="#2040a0">s</font><font color="4444FF">&lt;</font><font color="#FF0000">4</font><font color="4444FF">;</font> <font color="#2040a0">s</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="4444FF">)</font> <font color="#2040a0">oi</font><font color="4444FF">[</font><font color="#2040a0">s</font><font color="4444FF">]</font><font color="4444FF">+</font><font color="4444FF">=</font><font color="#2040a0">n</font>, <font color="#2040a0">ok</font><font color="4444FF">[</font><font color="#2040a0">s</font><font color="4444FF">]</font><font color="4444FF">+</font><font color="4444FF">=</font><font color="#2040a0">n</font><font color="4444FF">+</font><font color="#FF0000">1</font><font color="4444FF">;</font>
<a name="line1007">1007</a>             <font color="4444FF"><strong>}</strong></font>
<a name="line1008">1008</a>          <font color="4444FF"><strong>}</strong></font>
<a name="line1009">1009</a> 
<a name="line1010">1010</a>          <font color="#2040a0">fflush</font><font color="4444FF">(</font><font color="#2040a0">file</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line1011">1011</a>          <font color="#2040a0">fclose</font><font color="4444FF">(</font><font color="#2040a0">file</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line1012">1012</a> 
<a name="line1013">1013</a>          <font color="#2040a0">free</font><font color="4444FF">(</font><font color="#2040a0">xvalues</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line1014">1014</a>          <font color="#2040a0">free</font><font color="4444FF">(</font><font color="#2040a0">yvalues</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line1015">1015</a>          <font color="#2040a0">free</font><font color="4444FF">(</font><font color="#2040a0">zvalues</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line1016">1016</a>       <font color="4444FF"><strong>}</strong></font>
<a name="line1017">1017</a> 
<a name="line1018">1018</a>       <strong>if</strong> <font color="4444FF">(</font><font color="#2040a0">myid</font> <font color="4444FF">=</font><font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">)</font>
<a name="line1019">1019</a>       <font color="4444FF"><strong>{</strong></font>
<a name="line1020">1020</a>          <font color="#2040a0">printf</font><font color="4444FF">(</font><font color="#008000">&quot;<font color="#77dd77">\n</font>&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line1021">1021</a>          <font color="#2040a0">printf</font><font color="4444FF">(</font><font color="#008000">&quot;Iterations = %lld<font color="#77dd77">\n</font>&quot;</font>, <font color="#2040a0">its</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line1022">1022</a>          <font color="#2040a0">printf</font><font color="4444FF">(</font><font color="#008000">&quot;Final Relative Residual Norm = %g<font color="#77dd77">\n</font>&quot;</font>, <font color="#2040a0">final_res_norm</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line1023">1023</a>          <font color="#2040a0">printf</font><font color="4444FF">(</font><font color="#008000">&quot;<font color="#77dd77">\n</font>&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line1024">1024</a>       <font color="4444FF"><strong>}</strong></font>
<a name="line1025">1025</a>    <font color="4444FF"><strong>}</strong></font>
<a name="line1026">1026</a> 
<a name="line1027">1027</a>    <font color="#444444">/* Free memory */</font>
<a name="line1028">1028</a>    <font color="#2040a0">HYPRE_SStructGridDestroy</font><font color="4444FF">(</font><font color="#2040a0">edge_grid</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line1029">1029</a>    <font color="#2040a0">HYPRE_SStructGraphDestroy</font><font color="4444FF">(</font><font color="#2040a0">A_graph</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line1030">1030</a>    <font color="#2040a0">HYPRE_SStructMatrixDestroy</font><font color="4444FF">(</font><font color="#2040a0">A</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line1031">1031</a>    <font color="#2040a0">HYPRE_SStructVectorDestroy</font><font color="4444FF">(</font><font color="#2040a0">b</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line1032">1032</a>    <font color="#2040a0">HYPRE_SStructVectorDestroy</font><font color="4444FF">(</font><font color="#2040a0">x</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line1033">1033</a>    <font color="#2040a0">HYPRE_SStructGridDestroy</font><font color="4444FF">(</font><font color="#2040a0">node_grid</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line1034">1034</a>    <font color="#2040a0">HYPRE_SStructGraphDestroy</font><font color="4444FF">(</font><font color="#2040a0">G_graph</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line1035">1035</a>    <font color="#2040a0">HYPRE_SStructStencilDestroy</font><font color="4444FF">(</font><font color="#2040a0">G_stencil</font><font color="4444FF">[</font><font color="#FF0000">0</font><font color="4444FF">]</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line1036">1036</a>    <font color="#2040a0">HYPRE_SStructStencilDestroy</font><font color="4444FF">(</font><font color="#2040a0">G_stencil</font><font color="4444FF">[</font><font color="#FF0000">1</font><font color="4444FF">]</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line1037">1037</a>    <font color="#2040a0">HYPRE_SStructStencilDestroy</font><font color="4444FF">(</font><font color="#2040a0">G_stencil</font><font color="4444FF">[</font><font color="#FF0000">2</font><font color="4444FF">]</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line1038">1038</a>    <font color="#2040a0">HYPRE_SStructMatrixDestroy</font><font color="4444FF">(</font><font color="#2040a0">G</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line1039">1039</a>    <font color="#2040a0">HYPRE_SStructVectorDestroy</font><font color="4444FF">(</font><font color="#2040a0">xcoord</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line1040">1040</a>    <font color="#2040a0">HYPRE_SStructVectorDestroy</font><font color="4444FF">(</font><font color="#2040a0">ycoord</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line1041">1041</a>    <font color="#2040a0">HYPRE_SStructVectorDestroy</font><font color="4444FF">(</font><font color="#2040a0">zcoord</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line1042">1042</a> 
<a name="line1043">1043</a>    <font color="#444444">/* Finalize MPI */</font>
<a name="line1044">1044</a>    <font color="#2040a0">MPI_Finalize</font><font color="4444FF">(</font><font color="4444FF">)</font><font color="4444FF">;</font>
<a name="line1045">1045</a> 
<a name="line1046">1046</a>    <strong>return</strong> <font color="#FF0000">0</font><font color="4444FF">;</font>
<a name="line1047">1047</a> <font color="4444FF"><strong>}</strong></font>

</pre>
<hr>
syntax highlighted by <a href="http://www.palfrader.org/code2html">Code2HTML</a>, v. 0.9.1
</body>
</html>
